diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-24 17:49:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-24 17:49:20 +0800 |
commit | a666829a37be6f9fd98f9e7dd1767c420f7f3b32 (patch) | |
tree | 9ab1434b759a8a2cb275a83149903a823851e309 /models/issue_label_test.go | |
parent | 4e7ca946da2a2642a62f114825129bf5d7ed9196 (diff) | |
download | gitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.tar.gz gitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.zip |
Move user related model into models/user (#17781)
* Move user related model into models/user
* Fix lint for windows
* Fix windows lint
* Fix windows lint
* Move some tests in models
* Merge
Diffstat (limited to 'models/issue_label_test.go')
-rw-r--r-- | models/issue_label_test.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/models/issue_label_test.go b/models/issue_label_test.go index d0f807a56e..aa3c92b282 100644 --- a/models/issue_label_test.go +++ b/models/issue_label_test.go @@ -10,6 +10,7 @@ import ( "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/unittest" + user_model "code.gitea.io/gitea/models/user" "github.com/stretchr/testify/assert" ) @@ -296,7 +297,7 @@ func TestNewIssueLabel(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) label := unittest.AssertExistsAndLoadBean(t, &Label{ID: 2}).(*Label) issue := unittest.AssertExistsAndLoadBean(t, &Issue{ID: 1}).(*Issue) - doer := unittest.AssertExistsAndLoadBean(t, &User{ID: 2}).(*User) + doer := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}).(*user_model.User) // add new IssueLabel prevNumIssues := label.NumIssues @@ -322,7 +323,7 @@ func TestNewIssueLabels(t *testing.T) { label1 := unittest.AssertExistsAndLoadBean(t, &Label{ID: 1}).(*Label) label2 := unittest.AssertExistsAndLoadBean(t, &Label{ID: 2}).(*Label) issue := unittest.AssertExistsAndLoadBean(t, &Issue{ID: 5}).(*Issue) - doer := unittest.AssertExistsAndLoadBean(t, &User{ID: 2}).(*User) + doer := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}).(*user_model.User) assert.NoError(t, NewIssueLabels(issue, []*Label{label1, label2}, doer)) unittest.AssertExistsAndLoadBean(t, &IssueLabel{IssueID: issue.ID, LabelID: label1.ID}) @@ -352,7 +353,7 @@ func TestDeleteIssueLabel(t *testing.T) { testSuccess := func(labelID, issueID, doerID int64) { label := unittest.AssertExistsAndLoadBean(t, &Label{ID: labelID}).(*Label) issue := unittest.AssertExistsAndLoadBean(t, &Issue{ID: issueID}).(*Issue) - doer := unittest.AssertExistsAndLoadBean(t, &User{ID: doerID}).(*User) + doer := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: doerID}).(*user_model.User) expectedNumIssues := label.NumIssues expectedNumClosedIssues := label.NumClosedIssues |