diff options
Diffstat (limited to 'models/issue_user_test.go')
-rw-r--r-- | models/issue_user_test.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/models/issue_user_test.go b/models/issue_user_test.go index 1a9ae6395b..1be2763703 100644 --- a/models/issue_user_test.go +++ b/models/issue_user_test.go @@ -15,7 +15,7 @@ import ( func Test_newIssueUsers(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) - repo := db.AssertExistsAndLoadBean(t, &Repository{ID: 1}).(*Repository) + repo := unittest.AssertExistsAndLoadBean(t, &Repository{ID: 1}).(*Repository) newIssue := &Issue{ RepoID: repo.ID, PosterID: 4, @@ -25,35 +25,35 @@ func Test_newIssueUsers(t *testing.T) { } // artificially insert new issue - db.AssertSuccessfulInsert(t, newIssue) + unittest.AssertSuccessfulInsert(t, newIssue) assert.NoError(t, newIssueUsers(db.GetEngine(db.DefaultContext), repo, newIssue)) // issue_user table should now have entries for new issue - db.AssertExistsAndLoadBean(t, &IssueUser{IssueID: newIssue.ID, UID: newIssue.PosterID}) - db.AssertExistsAndLoadBean(t, &IssueUser{IssueID: newIssue.ID, UID: repo.OwnerID}) + unittest.AssertExistsAndLoadBean(t, &IssueUser{IssueID: newIssue.ID, UID: newIssue.PosterID}) + unittest.AssertExistsAndLoadBean(t, &IssueUser{IssueID: newIssue.ID, UID: repo.OwnerID}) } func TestUpdateIssueUserByRead(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) - issue := db.AssertExistsAndLoadBean(t, &Issue{ID: 1}).(*Issue) + issue := unittest.AssertExistsAndLoadBean(t, &Issue{ID: 1}).(*Issue) assert.NoError(t, UpdateIssueUserByRead(4, issue.ID)) - db.AssertExistsAndLoadBean(t, &IssueUser{IssueID: issue.ID, UID: 4}, "is_read=1") + unittest.AssertExistsAndLoadBean(t, &IssueUser{IssueID: issue.ID, UID: 4}, "is_read=1") assert.NoError(t, UpdateIssueUserByRead(4, issue.ID)) - db.AssertExistsAndLoadBean(t, &IssueUser{IssueID: issue.ID, UID: 4}, "is_read=1") + unittest.AssertExistsAndLoadBean(t, &IssueUser{IssueID: issue.ID, UID: 4}, "is_read=1") - assert.NoError(t, UpdateIssueUserByRead(db.NonexistentID, db.NonexistentID)) + assert.NoError(t, UpdateIssueUserByRead(unittest.NonexistentID, unittest.NonexistentID)) } func TestUpdateIssueUsersByMentions(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) - issue := db.AssertExistsAndLoadBean(t, &Issue{ID: 1}).(*Issue) + issue := unittest.AssertExistsAndLoadBean(t, &Issue{ID: 1}).(*Issue) uids := []int64{2, 5} assert.NoError(t, UpdateIssueUsersByMentions(db.DefaultContext, issue.ID, uids)) for _, uid := range uids { - db.AssertExistsAndLoadBean(t, &IssueUser{IssueID: issue.ID, UID: uid}, "is_mentioned=1") + unittest.AssertExistsAndLoadBean(t, &IssueUser{IssueID: issue.ID, UID: uid}, "is_mentioned=1") } } |