mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-21 17:00:01 +02:00
Even more db.DefaultContext
refactor (#27352)
Part of #27065 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
parent
08507e2760
commit
cc5df26680
97 changed files with 298 additions and 294 deletions
|
@ -82,7 +82,7 @@ func TestGetTrackedTimes(t *testing.T) {
|
|||
func TestTotalTimesForEachUser(t *testing.T) {
|
||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||
|
||||
total, err := issues_model.TotalTimesForEachUser(&issues_model.FindTrackedTimesOptions{IssueID: 1})
|
||||
total, err := issues_model.TotalTimesForEachUser(db.DefaultContext, &issues_model.FindTrackedTimesOptions{IssueID: 1})
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, total, 1)
|
||||
for user, time := range total {
|
||||
|
@ -90,7 +90,7 @@ func TestTotalTimesForEachUser(t *testing.T) {
|
|||
assert.EqualValues(t, 400, time)
|
||||
}
|
||||
|
||||
total, err = issues_model.TotalTimesForEachUser(&issues_model.FindTrackedTimesOptions{IssueID: 2})
|
||||
total, err = issues_model.TotalTimesForEachUser(db.DefaultContext, &issues_model.FindTrackedTimesOptions{IssueID: 2})
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, total, 2)
|
||||
for user, time := range total {
|
||||
|
@ -103,7 +103,7 @@ func TestTotalTimesForEachUser(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
total, err = issues_model.TotalTimesForEachUser(&issues_model.FindTrackedTimesOptions{IssueID: 5})
|
||||
total, err = issues_model.TotalTimesForEachUser(db.DefaultContext, &issues_model.FindTrackedTimesOptions{IssueID: 5})
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, total, 1)
|
||||
for user, time := range total {
|
||||
|
@ -111,7 +111,7 @@ func TestTotalTimesForEachUser(t *testing.T) {
|
|||
assert.EqualValues(t, 1, time)
|
||||
}
|
||||
|
||||
total, err = issues_model.TotalTimesForEachUser(&issues_model.FindTrackedTimesOptions{IssueID: 4})
|
||||
total, err = issues_model.TotalTimesForEachUser(db.DefaultContext, &issues_model.FindTrackedTimesOptions{IssueID: 4})
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, total, 2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue