summaryrefslogtreecommitdiffstats
path: root/models/user_test.go
diff options
context:
space:
mode:
authorKN4CK3R <KN4CK3R@users.noreply.github.com>2021-05-12 06:13:42 +0200
committerGitHub <noreply@github.com>2021-05-12 00:13:42 -0400
commit3d7d750a999b72d422000154a0b1f2801614521e (patch)
tree59aa048dd42f9ffaea431093cd1e49d1c8d23cd7 /models/user_test.go
parent96b1315e6eaf04954383348cbbb4d1ef7810651b (diff)
downloadgitea-3d7d750a999b72d422000154a0b1f2801614521e.tar.gz
gitea-3d7d750a999b72d422000154a0b1f2801614521e.zip
Fix individual tests (addition to #15802) (#15818)
* Decouple TestAction_GetRepoLink and TestSizedAvatarLink. * Load database for TestCheckGPGUserEmail. * Load database for TestMakeIDsFromAPIAssigneesToAdd. * Load database for TestGetUserIDsByNames and TestGetMaileableUsersByIDs. * Load database for TestUser_ToUser. * Load database for TestRepository_EditWikiPage. * Include AppSubURL in test. * Prevent panic with empty slice. Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'models/user_test.go')
-rw-r--r--models/user_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/user_test.go b/models/user_test.go
index 02319e4350..e0d4e164fc 100644
--- a/models/user_test.go
+++ b/models/user_test.go
@@ -368,6 +368,8 @@ func TestCreateUser_Issue5882(t *testing.T) {
}
func TestGetUserIDsByNames(t *testing.T) {
+ assert.NoError(t, PrepareTestDatabase())
+
// ignore non existing
IDs, err := GetUserIDsByNames([]string{"user1", "user2", "none_existing_user"}, true)
assert.NoError(t, err)
@@ -380,6 +382,8 @@ func TestGetUserIDsByNames(t *testing.T) {
}
func TestGetMaileableUsersByIDs(t *testing.T) {
+ assert.NoError(t, PrepareTestDatabase())
+
results, err := GetMaileableUsersByIDs([]int64{1, 4}, false)
assert.NoError(t, err)
assert.Equal(t, 1, len(results))