mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-19 11:00:02 +02:00
Decouple unit test code from business code (#17623)
This commit is contained in:
parent
7f802631c5
commit
df64fa4865
136 changed files with 1058 additions and 830 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
"time"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/models/unittest"
|
||||
"code.gitea.io/gitea/modules/json"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
||||
|
@ -39,7 +40,7 @@ func TestGetUserHeatmapDataByUser(t *testing.T) {
|
|||
{10, 10, 3, `[{"timestamp":1603009800,"contributions":1},{"timestamp":1603010700,"contributions":2}]`},
|
||||
}
|
||||
// Prepare
|
||||
assert.NoError(t, db.PrepareTestDatabase())
|
||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||
|
||||
// Mock time
|
||||
timeutil.Set(time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue