From 07b69f6c1823653c0cee4bd5d52442a684671ee5 Mon Sep 17 00:00:00 2001 From: SoXX Date: Tue, 25 Jun 2024 15:00:44 +0200 Subject: [PATCH] test(postgres): fixed to use new ORM Generic Signed-off-by: SoXX --- pkg/models/orm_test.go | 7 ++++--- pkg/models/post_test.go | 2 +- pkg/models/source_test.go | 2 +- pkg/models/user_test.go | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/models/orm_test.go b/pkg/models/orm_test.go index d18fd2b..cf9e1a4 100644 --- a/pkg/models/orm_test.go +++ b/pkg/models/orm_test.go @@ -1,9 +1,10 @@ package models import ( - "gorm.io/gorm" "testing" "time" + + "gorm.io/gorm" ) func TestBaseModel_BeforeCreate(t *testing.T) { @@ -41,8 +42,8 @@ func TestBaseModel_BeforeCreate(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - base := &BaseModel{ - ID: tt.fields.ID, + base := &BaseModel[AnthrovePostID]{ + ID: AnthrovePostID(tt.fields.ID), CreatedAt: tt.fields.CreatedAt, UpdatedAt: tt.fields.UpdatedAt, DeletedAt: tt.fields.DeletedAt, diff --git a/pkg/models/post_test.go b/pkg/models/post_test.go index c90852e..2e7228d 100644 --- a/pkg/models/post_test.go +++ b/pkg/models/post_test.go @@ -4,7 +4,7 @@ import "testing" func TestPost_TableName(t *testing.T) { type fields struct { - BaseModel BaseModel + BaseModel BaseModel[AnthrovePostID] Rating Rating Tags []Tag Favorites []UserFavorites diff --git a/pkg/models/source_test.go b/pkg/models/source_test.go index 1a5ff8c..e65b2c8 100644 --- a/pkg/models/source_test.go +++ b/pkg/models/source_test.go @@ -4,7 +4,7 @@ import "testing" func TestSource_TableName(t *testing.T) { type fields struct { - BaseModel BaseModel + BaseModel BaseModel[AnthroveSourceID] DisplayName string Domain string Icon string diff --git a/pkg/models/user_test.go b/pkg/models/user_test.go index fa2c511..c31745b 100644 --- a/pkg/models/user_test.go +++ b/pkg/models/user_test.go @@ -4,7 +4,7 @@ import "testing" func TestUser_TableName(t *testing.T) { type fields struct { - BaseModel BaseModel + BaseModel BaseModel[AnthroveUserID] Favorites []UserFavorites Sources []UserSource }