1
0
Fork 0
forked from forgejo/forgejo

Move change issue title from models to issue service package (#8456)

* move change issue title from models to issue service package

* make the change less

* fix typo
This commit is contained in:
Lunny Xiao 2019-10-11 14:44:43 +08:00 committed by GitHub
parent 9ff9f5ad1d
commit 46a12f196b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 71 additions and 61 deletions

View file

@ -13,6 +13,7 @@ import (
"code.gitea.io/gitea/modules/auth"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
issue_service "code.gitea.io/gitea/services/issue"
"github.com/stretchr/testify/assert"
)
@ -40,7 +41,7 @@ func TestAPIMergePullWIP(t *testing.T) {
owner := models.AssertExistsAndLoadBean(t, &models.User{ID: repo.OwnerID}).(*models.User)
pr := models.AssertExistsAndLoadBean(t, &models.PullRequest{Status: models.PullRequestStatusMergeable}, models.Cond("has_merged = ?", false)).(*models.PullRequest)
pr.LoadIssue()
pr.Issue.ChangeTitle(owner, setting.Repository.PullRequest.WorkInProgressPrefixes[0]+" "+pr.Issue.Title)
issue_service.ChangeTitle(pr.Issue, owner, setting.Repository.PullRequest.WorkInProgressPrefixes[0]+" "+pr.Issue.Title)
// force reload
pr.LoadAttributes()