Skip to content

Commit ca6a537

Browse files
authored
Merge branch 'main' into fix-code-highlight
2 parents 7850972 + 1a9821f commit ca6a537

File tree

186 files changed

+3672
-3682
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+3672
-3682
lines changed

cmd/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Ensure you are running in the correct environment or set the correct configurati
6868
If this is the intended configuration file complete the [database] section.`, setting.CustomConf)
6969
}
7070
if err := db.InitEngine(ctx); err != nil {
71-
return fmt.Errorf("unable to initialise the database using the configuration in %q. Error: %v", setting.CustomConf, err)
71+
return fmt.Errorf("unable to initialize the database using the configuration in %q. Error: %v", setting.CustomConf, err)
7272
}
7373
return nil
7474
}

docs/content/doc/advanced/logging-documentation.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ recommended that pausing only done for a very short period of time.
349349

350350
It is possible to add and remove logging whilst Gitea is running using the `gitea manager logging add` and `remove` subcommands.
351351
This functionality can only adjust running log systems and cannot be used to start the access or router loggers if they
352-
were not already initialised. If you wish to start these systems you are advised to adjust the app.ini and (gracefully) restart
352+
were not already initialized. If you wish to start these systems you are advised to adjust the app.ini and (gracefully) restart
353353
the Gitea service.
354354

355355
The main intention of these commands is to easily add a temporary logger to investigate problems on running systems where a restart

integrations/api_comment_test.go

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"net/url"
1111
"testing"
1212

13-
"code.gitea.io/gitea/models"
13+
issues_model "code.gitea.io/gitea/models/issues"
1414
repo_model "code.gitea.io/gitea/models/repo"
1515
"code.gitea.io/gitea/models/unittest"
1616
user_model "code.gitea.io/gitea/models/user"
@@ -23,9 +23,9 @@ import (
2323
func TestAPIListRepoComments(t *testing.T) {
2424
defer prepareTestEnv(t)()
2525

26-
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{},
27-
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
28-
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
26+
comment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{},
27+
unittest.Cond("type = ?", issues_model.CommentTypeComment)).(*issues_model.Comment)
28+
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: comment.IssueID}).(*issues_model.Issue)
2929
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
3030
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
3131

@@ -38,10 +38,10 @@ func TestAPIListRepoComments(t *testing.T) {
3838
DecodeJSON(t, resp, &apiComments)
3939
assert.Len(t, apiComments, 2)
4040
for _, apiComment := range apiComments {
41-
c := &models.Comment{ID: apiComment.ID}
41+
c := &issues_model.Comment{ID: apiComment.ID}
4242
unittest.AssertExistsAndLoadBean(t, c,
43-
unittest.Cond("type = ?", models.CommentTypeComment))
44-
unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: c.IssueID, RepoID: repo.ID})
43+
unittest.Cond("type = ?", issues_model.CommentTypeComment))
44+
unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: c.IssueID, RepoID: repo.ID})
4545
}
4646

4747
// test before and since filters
@@ -69,9 +69,9 @@ func TestAPIListRepoComments(t *testing.T) {
6969
func TestAPIListIssueComments(t *testing.T) {
7070
defer prepareTestEnv(t)()
7171

72-
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{},
73-
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
74-
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
72+
comment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{},
73+
unittest.Cond("type = ?", issues_model.CommentTypeComment)).(*issues_model.Comment)
74+
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: comment.IssueID}).(*issues_model.Issue)
7575
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
7676
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
7777

@@ -82,16 +82,16 @@ func TestAPIListIssueComments(t *testing.T) {
8282

8383
var comments []*api.Comment
8484
DecodeJSON(t, resp, &comments)
85-
expectedCount := unittest.GetCount(t, &models.Comment{IssueID: issue.ID},
86-
unittest.Cond("type = ?", models.CommentTypeComment))
85+
expectedCount := unittest.GetCount(t, &issues_model.Comment{IssueID: issue.ID},
86+
unittest.Cond("type = ?", issues_model.CommentTypeComment))
8787
assert.EqualValues(t, expectedCount, len(comments))
8888
}
8989

9090
func TestAPICreateComment(t *testing.T) {
9191
defer prepareTestEnv(t)()
9292
const commentBody = "Comment body"
9393

94-
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{}).(*models.Issue)
94+
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{}).(*issues_model.Issue)
9595
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
9696
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
9797

@@ -107,13 +107,13 @@ func TestAPICreateComment(t *testing.T) {
107107
var updatedComment api.Comment
108108
DecodeJSON(t, resp, &updatedComment)
109109
assert.EqualValues(t, commentBody, updatedComment.Body)
110-
unittest.AssertExistsAndLoadBean(t, &models.Comment{ID: updatedComment.ID, IssueID: issue.ID, Content: commentBody})
110+
unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: updatedComment.ID, IssueID: issue.ID, Content: commentBody})
111111
}
112112

113113
func TestAPIGetComment(t *testing.T) {
114114
defer prepareTestEnv(t)()
115115

116-
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{ID: 2}).(*models.Comment)
116+
comment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: 2}).(*issues_model.Comment)
117117
assert.NoError(t, comment.LoadIssue())
118118
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: comment.Issue.RepoID}).(*repo_model.Repository)
119119
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
@@ -141,9 +141,9 @@ func TestAPIEditComment(t *testing.T) {
141141
defer prepareTestEnv(t)()
142142
const newCommentBody = "This is the new comment body"
143143

144-
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{},
145-
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
146-
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
144+
comment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{},
145+
unittest.Cond("type = ?", issues_model.CommentTypeComment)).(*issues_model.Comment)
146+
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: comment.IssueID}).(*issues_model.Issue)
147147
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
148148
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
149149

@@ -160,15 +160,15 @@ func TestAPIEditComment(t *testing.T) {
160160
DecodeJSON(t, resp, &updatedComment)
161161
assert.EqualValues(t, comment.ID, updatedComment.ID)
162162
assert.EqualValues(t, newCommentBody, updatedComment.Body)
163-
unittest.AssertExistsAndLoadBean(t, &models.Comment{ID: comment.ID, IssueID: issue.ID, Content: newCommentBody})
163+
unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: comment.ID, IssueID: issue.ID, Content: newCommentBody})
164164
}
165165

166166
func TestAPIDeleteComment(t *testing.T) {
167167
defer prepareTestEnv(t)()
168168

169-
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{},
170-
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
171-
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
169+
comment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{},
170+
unittest.Cond("type = ?", issues_model.CommentTypeComment)).(*issues_model.Comment)
171+
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: comment.IssueID}).(*issues_model.Issue)
172172
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
173173
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
174174

@@ -178,14 +178,14 @@ func TestAPIDeleteComment(t *testing.T) {
178178
repoOwner.Name, repo.Name, comment.ID, token)
179179
session.MakeRequest(t, req, http.StatusNoContent)
180180

181-
unittest.AssertNotExistsBean(t, &models.Comment{ID: comment.ID})
181+
unittest.AssertNotExistsBean(t, &issues_model.Comment{ID: comment.ID})
182182
}
183183

184184
func TestAPIListIssueTimeline(t *testing.T) {
185185
defer prepareTestEnv(t)()
186186

187187
// load comment
188-
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: 1}).(*models.Issue)
188+
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 1}).(*issues_model.Issue)
189189
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
190190
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
191191

@@ -199,6 +199,6 @@ func TestAPIListIssueTimeline(t *testing.T) {
199199
// lists extracted directly from DB are the same
200200
var comments []*api.TimelineComment
201201
DecodeJSON(t, resp, &comments)
202-
expectedCount := unittest.GetCount(t, &models.Comment{IssueID: issue.ID})
202+
expectedCount := unittest.GetCount(t, &issues_model.Comment{IssueID: issue.ID})
203203
assert.EqualValues(t, expectedCount, len(comments))
204204
}

integrations/api_issue_label_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"strings"
1111
"testing"
1212

13-
"code.gitea.io/gitea/models"
13+
issues_model "code.gitea.io/gitea/models/issues"
1414
repo_model "code.gitea.io/gitea/models/repo"
1515
"code.gitea.io/gitea/models/unittest"
1616
user_model "code.gitea.io/gitea/models/user"
@@ -37,7 +37,7 @@ func TestAPIModifyLabels(t *testing.T) {
3737
resp := session.MakeRequest(t, req, http.StatusCreated)
3838
apiLabel := new(api.Label)
3939
DecodeJSON(t, resp, &apiLabel)
40-
dbLabel := unittest.AssertExistsAndLoadBean(t, &models.Label{ID: apiLabel.ID, RepoID: repo.ID}).(*models.Label)
40+
dbLabel := unittest.AssertExistsAndLoadBean(t, &issues_model.Label{ID: apiLabel.ID, RepoID: repo.ID}).(*issues_model.Label)
4141
assert.EqualValues(t, dbLabel.Name, apiLabel.Name)
4242
assert.EqualValues(t, strings.TrimLeft(dbLabel.Color, "#"), apiLabel.Color)
4343

@@ -92,8 +92,8 @@ func TestAPIAddIssueLabels(t *testing.T) {
9292
assert.NoError(t, unittest.LoadFixtures())
9393

9494
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}).(*repo_model.Repository)
95-
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{RepoID: repo.ID}).(*models.Issue)
96-
_ = unittest.AssertExistsAndLoadBean(t, &models.Label{RepoID: repo.ID, ID: 2}).(*models.Label)
95+
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{RepoID: repo.ID}).(*issues_model.Issue)
96+
_ = unittest.AssertExistsAndLoadBean(t, &issues_model.Label{RepoID: repo.ID, ID: 2}).(*issues_model.Label)
9797
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
9898

9999
session := loginUser(t, owner.Name)
@@ -106,17 +106,17 @@ func TestAPIAddIssueLabels(t *testing.T) {
106106
resp := session.MakeRequest(t, req, http.StatusOK)
107107
var apiLabels []*api.Label
108108
DecodeJSON(t, resp, &apiLabels)
109-
assert.Len(t, apiLabels, unittest.GetCount(t, &models.IssueLabel{IssueID: issue.ID}))
109+
assert.Len(t, apiLabels, unittest.GetCount(t, &issues_model.IssueLabel{IssueID: issue.ID}))
110110

111-
unittest.AssertExistsAndLoadBean(t, &models.IssueLabel{IssueID: issue.ID, LabelID: 2})
111+
unittest.AssertExistsAndLoadBean(t, &issues_model.IssueLabel{IssueID: issue.ID, LabelID: 2})
112112
}
113113

114114
func TestAPIReplaceIssueLabels(t *testing.T) {
115115
assert.NoError(t, unittest.LoadFixtures())
116116

117117
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}).(*repo_model.Repository)
118-
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{RepoID: repo.ID}).(*models.Issue)
119-
label := unittest.AssertExistsAndLoadBean(t, &models.Label{RepoID: repo.ID}).(*models.Label)
118+
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{RepoID: repo.ID}).(*issues_model.Issue)
119+
label := unittest.AssertExistsAndLoadBean(t, &issues_model.Label{RepoID: repo.ID}).(*issues_model.Label)
120120
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
121121

122122
session := loginUser(t, owner.Name)
@@ -133,8 +133,8 @@ func TestAPIReplaceIssueLabels(t *testing.T) {
133133
assert.EqualValues(t, label.ID, apiLabels[0].ID)
134134
}
135135

136-
unittest.AssertCount(t, &models.IssueLabel{IssueID: issue.ID}, 1)
137-
unittest.AssertExistsAndLoadBean(t, &models.IssueLabel{IssueID: issue.ID, LabelID: label.ID})
136+
unittest.AssertCount(t, &issues_model.IssueLabel{IssueID: issue.ID}, 1)
137+
unittest.AssertExistsAndLoadBean(t, &issues_model.IssueLabel{IssueID: issue.ID, LabelID: label.ID})
138138
}
139139

140140
func TestAPIModifyOrgLabels(t *testing.T) {
@@ -156,7 +156,7 @@ func TestAPIModifyOrgLabels(t *testing.T) {
156156
resp := session.MakeRequest(t, req, http.StatusCreated)
157157
apiLabel := new(api.Label)
158158
DecodeJSON(t, resp, &apiLabel)
159-
dbLabel := unittest.AssertExistsAndLoadBean(t, &models.Label{ID: apiLabel.ID, OrgID: owner.ID}).(*models.Label)
159+
dbLabel := unittest.AssertExistsAndLoadBean(t, &issues_model.Label{ID: apiLabel.ID, OrgID: owner.ID}).(*issues_model.Label)
160160
assert.EqualValues(t, dbLabel.Name, apiLabel.Name)
161161
assert.EqualValues(t, strings.TrimLeft(dbLabel.Color, "#"), apiLabel.Color)
162162

integrations/api_issue_reaction_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"testing"
1111
"time"
1212

13-
"code.gitea.io/gitea/models"
1413
"code.gitea.io/gitea/models/db"
14+
issues_model "code.gitea.io/gitea/models/issues"
1515
"code.gitea.io/gitea/models/unittest"
1616
user_model "code.gitea.io/gitea/models/user"
1717
"code.gitea.io/gitea/modules/convert"
@@ -23,7 +23,7 @@ import (
2323
func TestAPIIssuesReactions(t *testing.T) {
2424
defer prepareTestEnv(t)()
2525

26-
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: 1}).(*models.Issue)
26+
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 1}).(*issues_model.Issue)
2727
_ = issue.LoadRepo(db.DefaultContext)
2828
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: issue.Repo.OwnerID}).(*user_model.User)
2929

@@ -80,7 +80,7 @@ func TestAPIIssuesReactions(t *testing.T) {
8080
func TestAPICommentReactions(t *testing.T) {
8181
defer prepareTestEnv(t)()
8282

83-
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{ID: 2}).(*models.Comment)
83+
comment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: 2}).(*issues_model.Comment)
8484
_ = comment.LoadIssue()
8585
issue := comment.Issue
8686
_ = issue.LoadRepo(db.DefaultContext)

integrations/api_issue_stopwatch_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"net/http"
99
"testing"
1010

11-
"code.gitea.io/gitea/models"
1211
"code.gitea.io/gitea/models/db"
12+
issues_model "code.gitea.io/gitea/models/issues"
1313
repo_model "code.gitea.io/gitea/models/repo"
1414
"code.gitea.io/gitea/models/unittest"
1515
user_model "code.gitea.io/gitea/models/user"
@@ -30,8 +30,8 @@ func TestAPIListStopWatches(t *testing.T) {
3030
resp := session.MakeRequest(t, req, http.StatusOK)
3131
var apiWatches []*api.StopWatch
3232
DecodeJSON(t, resp, &apiWatches)
33-
stopwatch := unittest.AssertExistsAndLoadBean(t, &models.Stopwatch{UserID: owner.ID}).(*models.Stopwatch)
34-
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: stopwatch.IssueID}).(*models.Issue)
33+
stopwatch := unittest.AssertExistsAndLoadBean(t, &issues_model.Stopwatch{UserID: owner.ID}).(*issues_model.Stopwatch)
34+
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: stopwatch.IssueID}).(*issues_model.Issue)
3535
if assert.Len(t, apiWatches, 1) {
3636
assert.EqualValues(t, stopwatch.CreatedUnix.AsTime().Unix(), apiWatches[0].Created.Unix())
3737
assert.EqualValues(t, issue.Index, apiWatches[0].IssueIndex)
@@ -45,7 +45,7 @@ func TestAPIListStopWatches(t *testing.T) {
4545
func TestAPIStopStopWatches(t *testing.T) {
4646
defer prepareTestEnv(t)()
4747

48-
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: 2}).(*models.Issue)
48+
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 2}).(*issues_model.Issue)
4949
_ = issue.LoadRepo(db.DefaultContext)
5050
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: issue.Repo.OwnerID}).(*user_model.User)
5151
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}).(*user_model.User)
@@ -61,7 +61,7 @@ func TestAPIStopStopWatches(t *testing.T) {
6161
func TestAPICancelStopWatches(t *testing.T) {
6262
defer prepareTestEnv(t)()
6363

64-
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: 1}).(*models.Issue)
64+
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 1}).(*issues_model.Issue)
6565
_ = issue.LoadRepo(db.DefaultContext)
6666
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: issue.Repo.OwnerID}).(*user_model.User)
6767
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1}).(*user_model.User)
@@ -77,7 +77,7 @@ func TestAPICancelStopWatches(t *testing.T) {
7777
func TestAPIStartStopWatches(t *testing.T) {
7878
defer prepareTestEnv(t)()
7979

80-
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: 3}).(*models.Issue)
80+
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 3}).(*issues_model.Issue)
8181
_ = issue.LoadRepo(db.DefaultContext)
8282
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: issue.Repo.OwnerID}).(*user_model.User)
8383
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}).(*user_model.User)

integrations/api_issue_subscription_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"net/http"
1010
"testing"
1111

12-
"code.gitea.io/gitea/models"
12+
issues_model "code.gitea.io/gitea/models/issues"
1313
repo_model "code.gitea.io/gitea/models/repo"
1414
"code.gitea.io/gitea/models/unittest"
1515
user_model "code.gitea.io/gitea/models/user"
@@ -21,18 +21,18 @@ import (
2121
func TestAPIIssueSubscriptions(t *testing.T) {
2222
defer prepareTestEnv(t)()
2323

24-
issue1 := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: 1}).(*models.Issue)
25-
issue2 := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: 2}).(*models.Issue)
26-
issue3 := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: 3}).(*models.Issue)
27-
issue4 := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: 4}).(*models.Issue)
28-
issue5 := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: 8}).(*models.Issue)
24+
issue1 := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 1}).(*issues_model.Issue)
25+
issue2 := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 2}).(*issues_model.Issue)
26+
issue3 := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 3}).(*issues_model.Issue)
27+
issue4 := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 4}).(*issues_model.Issue)
28+
issue5 := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 8}).(*issues_model.Issue)
2929

3030
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: issue1.PosterID}).(*user_model.User)
3131

3232
session := loginUser(t, owner.Name)
3333
token := getTokenForLoggedInUser(t, session)
3434

35-
testSubscription := func(issue *models.Issue, isWatching bool) {
35+
testSubscription := func(issue *issues_model.Issue, isWatching bool) {
3636
issueRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
3737

3838
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/issues/%d/subscriptions/check?token=%s", issueRepo.OwnerName, issueRepo.Name, issue.Index, token)

0 commit comments

Comments
 (0)