diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-03-31 17:20:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 17:20:39 +0800 |
commit | d4f84f1c937e24e71aa5f05c58d440cde741450f (patch) | |
tree | 18571ad08fabe6d1090ea4d2674beab3b1c00a6e /models/migrate_test.go | |
parent | 43332a483f7838df66e0209eb9c15d4aba3d5874 (diff) | |
download | gitea-d4f84f1c937e24e71aa5f05c58d440cde741450f.tar.gz gitea-d4f84f1c937e24e71aa5f05c58d440cde741450f.zip |
Move reaction to models/issues/ (#19264)
* Move reaction to models/issues/
* Fix test
* move the function
* improve code
* Update models/issues/reaction.go
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'models/migrate_test.go')
-rw-r--r-- | models/migrate_test.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/models/migrate_test.go b/models/migrate_test.go index f4af7ffe37..6da434d76a 100644 --- a/models/migrate_test.go +++ b/models/migrate_test.go @@ -9,6 +9,7 @@ import ( "testing" "code.gitea.io/gitea/models/foreignreference" + issues_model "code.gitea.io/gitea/models/issues" repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/models/unittest" user_model "code.gitea.io/gitea/models/user" @@ -42,7 +43,7 @@ func assertCreateIssues(t *testing.T, isPull bool) { label := unittest.AssertExistsAndLoadBean(t, &Label{ID: 1}).(*Label) milestone := unittest.AssertExistsAndLoadBean(t, &Milestone{ID: 1}).(*Milestone) assert.EqualValues(t, milestone.ID, 1) - reaction := &Reaction{ + reaction := &issues_model.Reaction{ Type: "heart", UserID: owner.ID, } @@ -60,7 +61,7 @@ func assertCreateIssues(t *testing.T, isPull bool) { Poster: owner, IsClosed: true, Labels: []*Label{label}, - Reactions: []*Reaction{reaction}, + Reactions: []*issues_model.Reaction{reaction}, ForeignReference: &foreignreference.ForeignReference{ ForeignIndex: strconv.FormatInt(foreignIndex, 10), RepoID: repo.ID, @@ -75,7 +76,7 @@ func assertCreateIssues(t *testing.T, isPull bool) { err = i.LoadAttributes() assert.NoError(t, err) assert.EqualValues(t, strconv.FormatInt(foreignIndex, 10), i.ForeignReference.ForeignIndex) - unittest.AssertExistsAndLoadBean(t, &Reaction{Type: "heart", UserID: owner.ID, IssueID: i.ID}) + unittest.AssertExistsAndLoadBean(t, &issues_model.Reaction{Type: "heart", UserID: owner.ID, IssueID: i.ID}) } func TestMigrate_CreateIssuesIsPullFalse(t *testing.T) { @@ -91,7 +92,7 @@ func TestMigrate_InsertIssueComments(t *testing.T) { issue := unittest.AssertExistsAndLoadBean(t, &Issue{ID: 1}).(*Issue) _ = issue.LoadRepo() owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: issue.Repo.OwnerID}).(*user_model.User) - reaction := &Reaction{ + reaction := &issues_model.Reaction{ Type: "heart", UserID: owner.ID, } @@ -101,7 +102,7 @@ func TestMigrate_InsertIssueComments(t *testing.T) { Poster: owner, IssueID: issue.ID, Issue: issue, - Reactions: []*Reaction{reaction}, + Reactions: []*issues_model.Reaction{reaction}, } err := InsertIssueComments([]*Comment{comment}) |