diff options
author | JakobDev <jakobdev@gmx.de> | 2023-09-16 16:39:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-16 14:39:12 +0000 |
commit | f91dbbba98c841f11d99be998ed5dd98122a457c (patch) | |
tree | 9c6c935ccf745c5a1716f1330922354809cd39e0 /models/user/follow_test.go | |
parent | a1b2a118123e0abd1d4737f4a6c0cf56d15eff57 (diff) | |
download | gitea-f91dbbba98c841f11d99be998ed5dd98122a457c.tar.gz gitea-f91dbbba98c841f11d99be998ed5dd98122a457c.zip |
Next round of `db.DefaultContext` refactor (#27089)
Part of #27065
Diffstat (limited to 'models/user/follow_test.go')
-rw-r--r-- | models/user/follow_test.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/models/user/follow_test.go b/models/user/follow_test.go index fc408d5257..c327d935ae 100644 --- a/models/user/follow_test.go +++ b/models/user/follow_test.go @@ -6,6 +6,7 @@ package user_test import ( "testing" + "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/unittest" user_model "code.gitea.io/gitea/models/user" @@ -14,9 +15,9 @@ import ( func TestIsFollowing(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) - assert.True(t, user_model.IsFollowing(4, 2)) - assert.False(t, user_model.IsFollowing(2, 4)) - assert.False(t, user_model.IsFollowing(5, unittest.NonexistentID)) - assert.False(t, user_model.IsFollowing(unittest.NonexistentID, 5)) - assert.False(t, user_model.IsFollowing(unittest.NonexistentID, unittest.NonexistentID)) + assert.True(t, user_model.IsFollowing(db.DefaultContext, 4, 2)) + assert.False(t, user_model.IsFollowing(db.DefaultContext, 2, 4)) + assert.False(t, user_model.IsFollowing(db.DefaultContext, 5, unittest.NonexistentID)) + assert.False(t, user_model.IsFollowing(db.DefaultContext, unittest.NonexistentID, 5)) + assert.False(t, user_model.IsFollowing(db.DefaultContext, unittest.NonexistentID, unittest.NonexistentID)) } |