diff options
Diffstat (limited to 'models/notification_test.go')
-rw-r--r-- | models/notification_test.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/models/notification_test.go b/models/notification_test.go index 3b05f34c55..15c29389c8 100644 --- a/models/notification_test.go +++ b/models/notification_test.go @@ -7,6 +7,7 @@ package models import ( "testing" + "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/unittest" user_model "code.gitea.io/gitea/models/user" @@ -32,7 +33,7 @@ func TestNotificationsForUser(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}).(*user_model.User) statuses := []NotificationStatus{NotificationStatusRead, NotificationStatusUnread} - notfs, err := NotificationsForUser(user, statuses, 1, 10) + notfs, err := NotificationsForUser(db.DefaultContext, user, statuses, 1, 10) assert.NoError(t, err) if assert.Len(t, notfs, 3) { assert.EqualValues(t, 5, notfs[0].ID) @@ -65,11 +66,11 @@ func TestNotification_GetIssue(t *testing.T) { func TestGetNotificationCount(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1}).(*user_model.User) - cnt, err := GetNotificationCount(user, NotificationStatusRead) + cnt, err := GetNotificationCount(db.DefaultContext, user, NotificationStatusRead) assert.NoError(t, err) assert.EqualValues(t, 0, cnt) - cnt, err = GetNotificationCount(user, NotificationStatusUnread) + cnt, err = GetNotificationCount(db.DefaultContext, user, NotificationStatusUnread) assert.NoError(t, err) assert.EqualValues(t, 1, cnt) } |