aboutsummaryrefslogtreecommitdiffstats
path: root/models/user/user_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/user/user_test.go')
-rw-r--r--models/user/user_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/models/user/user_test.go b/models/user/user_test.go
index 335537aa13..0dbf2fc205 100644
--- a/models/user/user_test.go
+++ b/models/user/user_test.go
@@ -31,10 +31,10 @@ func TestGetUserEmailsByNames(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
// ignore none active user email
- assert.Equal(t, []string{"user8@example.com"}, GetUserEmailsByNames([]string{"user8", "user9"}))
- assert.Equal(t, []string{"user8@example.com", "user5@example.com"}, GetUserEmailsByNames([]string{"user8", "user5"}))
+ assert.Equal(t, []string{"user8@example.com"}, GetUserEmailsByNames(db.DefaultContext, []string{"user8", "user9"}))
+ assert.Equal(t, []string{"user8@example.com", "user5@example.com"}, GetUserEmailsByNames(db.DefaultContext, []string{"user8", "user5"}))
- assert.Equal(t, []string{"user8@example.com"}, GetUserEmailsByNames([]string{"user8", "user7"}))
+ assert.Equal(t, []string{"user8@example.com"}, GetUserEmailsByNames(db.DefaultContext, []string{"user8", "user7"}))
}
func TestCanCreateOrganization(t *testing.T) {
@@ -287,19 +287,19 @@ func TestUpdateUser(t *testing.T) {
user := unittest.AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
user.KeepActivityPrivate = true
- assert.NoError(t, UpdateUser(user, false))
+ assert.NoError(t, UpdateUser(db.DefaultContext, user, false))
user = unittest.AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
assert.True(t, user.KeepActivityPrivate)
setting.Service.AllowedUserVisibilityModesSlice = []bool{true, false, false}
user.KeepActivityPrivate = false
user.Visibility = structs.VisibleTypePrivate
- assert.Error(t, UpdateUser(user, false))
+ assert.Error(t, UpdateUser(db.DefaultContext, user, false))
user = unittest.AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
assert.True(t, user.KeepActivityPrivate)
user.Email = "no mail@mail.org"
- assert.Error(t, UpdateUser(user, true))
+ assert.Error(t, UpdateUser(db.DefaultContext, user, true))
}
func TestNewUserRedirect(t *testing.T) {