diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-04-08 17:11:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-08 17:11:15 +0800 |
commit | 1dfa26e00e8e1ce6f6125335871da1d402a63466 (patch) | |
tree | d39414fb085ae52d6633ae9d064aabab2e7f75f8 /services/mailer/mail_test.go | |
parent | 84ceaa98bd731431c7d3a7f65e59e7ad076a540f (diff) | |
download | gitea-1dfa26e00e8e1ce6f6125335871da1d402a63466.tar.gz gitea-1dfa26e00e8e1ce6f6125335871da1d402a63466.zip |
Move milestone to models/issues/ (#19278)
* Move milestone to models/issues/
* Fix lint
* Fix test
* Fix lint
* Fix lint
Diffstat (limited to 'services/mailer/mail_test.go')
-rw-r--r-- | services/mailer/mail_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/mailer/mail_test.go b/services/mailer/mail_test.go index c06bae1b98..baf426146a 100644 --- a/services/mailer/mail_test.go +++ b/services/mailer/mail_test.go @@ -14,6 +14,7 @@ import ( texttmpl "text/template" "code.gitea.io/gitea/models" + "code.gitea.io/gitea/models/db" repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/models/unittest" user_model "code.gitea.io/gitea/models/user" @@ -57,7 +58,7 @@ func prepareMailerTest(t *testing.T) (doer *user_model.User, repo *repo_model.Re doer = unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}).(*user_model.User) repo = unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1, Owner: doer}).(*repo_model.Repository) issue = unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: 1, Repo: repo, Poster: doer}).(*models.Issue) - assert.NoError(t, issue.LoadRepo()) + assert.NoError(t, issue.LoadRepo(db.DefaultContext)) comment = unittest.AssertExistsAndLoadBean(t, &models.Comment{ID: 2, Issue: issue}).(*models.Comment) return } @@ -180,7 +181,7 @@ func TestTemplateSelection(t *testing.T) { func TestTemplateServices(t *testing.T) { doer, _, issue, comment := prepareMailerTest(t) - assert.NoError(t, issue.LoadRepo()) + assert.NoError(t, issue.LoadRepo(db.DefaultContext)) expect := func(t *testing.T, issue *models.Issue, comment *models.Comment, doer *user_model.User, actionType models.ActionType, fromMention bool, tplSubject, tplBody, expSubject, expBody string, |