mirror of https://gitee.com/answerdev/answer.git
fix: repo test set notification userID to correct
This commit is contained in:
parent
a0b0adde8d
commit
d833cadae2
|
@ -81,7 +81,7 @@ func Test_notificationRepo_GetNotificationPage(t *testing.T) {
|
|||
err := notificationRepo.AddNotification(context.TODO(), ent)
|
||||
assert.NoError(t, err)
|
||||
|
||||
notificationPage, total, err := notificationRepo.GetNotificationPage(context.TODO(), &schema.NotificationSearch{UserID: userID})
|
||||
notificationPage, total, err := notificationRepo.GetNotificationPage(context.TODO(), &schema.NotificationSearch{UserID: ent.UserID})
|
||||
assert.NoError(t, err)
|
||||
assert.True(t, total > 0)
|
||||
assert.Equal(t, notificationPage[0].UserID, ent.UserID)
|
||||
|
|
|
@ -52,7 +52,8 @@ var (
|
|||
func TestMain(t *testing.M) {
|
||||
dbSetting, ok := dbSettingMapping[os.Getenv("TEST_DB_DRIVER")]
|
||||
if !ok {
|
||||
dbSetting = dbSettingMapping[string(schemas.MYSQL)]
|
||||
// Use sqlite3 to test.
|
||||
dbSetting = dbSettingMapping[string(schemas.SQLITE)]
|
||||
}
|
||||
defer func() {
|
||||
if tearDown != nil {
|
||||
|
|
Loading…
Reference in New Issue