diff options
Diffstat (limited to 'models/review_test.go')
-rw-r--r-- | models/review_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/models/review_test.go b/models/review_test.go index a4a71cc709..93291f9f57 100644 --- a/models/review_test.go +++ b/models/review_test.go @@ -16,12 +16,12 @@ import ( func TestGetReviewByID(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) - review, err := GetReviewByID(1) + review, err := GetReviewByID(db.DefaultContext, 1) assert.NoError(t, err) assert.Equal(t, "Demo Review", review.Content) assert.Equal(t, ReviewTypeApprove, review.Type) - _, err = GetReviewByID(23892) + _, err = GetReviewByID(db.DefaultContext, 23892) assert.Error(t, err) assert.True(t, IsErrReviewNotExist(err), "IsErrReviewNotExist") } @@ -61,7 +61,7 @@ func TestReviewType_Icon(t *testing.T) { func TestFindReviews(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) - reviews, err := FindReviews(FindReviewOptions{ + reviews, err := FindReviews(db.DefaultContext, FindReviewOptions{ Type: ReviewTypeApprove, IssueID: 2, ReviewerID: 1, @@ -76,14 +76,14 @@ func TestGetCurrentReview(t *testing.T) { issue := unittest.AssertExistsAndLoadBean(t, &Issue{ID: 2}).(*Issue) user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1}).(*user_model.User) - review, err := GetCurrentReview(user, issue) + review, err := GetCurrentReview(db.DefaultContext, user, issue) assert.NoError(t, err) assert.NotNil(t, review) assert.Equal(t, ReviewTypePending, review.Type) assert.Equal(t, "Pending Review", review.Content) user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 7}).(*user_model.User) - review2, err := GetCurrentReview(user2, issue) + review2, err := GetCurrentReview(db.DefaultContext, user2, issue) assert.Error(t, err) assert.True(t, IsErrReviewNotExist(err)) assert.Nil(t, review2) @@ -95,7 +95,7 @@ func TestCreateReview(t *testing.T) { issue := unittest.AssertExistsAndLoadBean(t, &Issue{ID: 2}).(*Issue) user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1}).(*user_model.User) - review, err := CreateReview(CreateReviewOptions{ + review, err := CreateReview(db.DefaultContext, CreateReviewOptions{ Content: "New Review", Type: ReviewTypePending, Issue: issue, |