aboutsummaryrefslogtreecommitdiffstats
path: root/models/review_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-24 17:49:20 +0800
committerGitHub <noreply@github.com>2021-11-24 17:49:20 +0800
commita666829a37be6f9fd98f9e7dd1767c420f7f3b32 (patch)
tree9ab1434b759a8a2cb275a83149903a823851e309 /models/review_test.go
parent4e7ca946da2a2642a62f114825129bf5d7ed9196 (diff)
downloadgitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.tar.gz
gitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.zip
Move user related model into models/user (#17781)
* Move user related model into models/user * Fix lint for windows * Fix windows lint * Fix windows lint * Move some tests in models * Merge
Diffstat (limited to 'models/review_test.go')
-rw-r--r--models/review_test.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/models/review_test.go b/models/review_test.go
index 7b8b86df13..b9d156ceb1 100644
--- a/models/review_test.go
+++ b/models/review_test.go
@@ -8,6 +8,7 @@ import (
"testing"
"code.gitea.io/gitea/models/unittest"
+ user_model "code.gitea.io/gitea/models/user"
"github.com/stretchr/testify/assert"
)
@@ -72,7 +73,7 @@ func TestFindReviews(t *testing.T) {
func TestGetCurrentReview(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
issue := unittest.AssertExistsAndLoadBean(t, &Issue{ID: 2}).(*Issue)
- user := unittest.AssertExistsAndLoadBean(t, &User{ID: 1}).(*User)
+ user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1}).(*user_model.User)
review, err := GetCurrentReview(user, issue)
assert.NoError(t, err)
@@ -80,7 +81,7 @@ func TestGetCurrentReview(t *testing.T) {
assert.Equal(t, ReviewTypePending, review.Type)
assert.Equal(t, "Pending Review", review.Content)
- user2 := unittest.AssertExistsAndLoadBean(t, &User{ID: 7}).(*User)
+ user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 7}).(*user_model.User)
review2, err := GetCurrentReview(user2, issue)
assert.Error(t, err)
assert.True(t, IsErrReviewNotExist(err))
@@ -91,7 +92,7 @@ func TestCreateReview(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
issue := unittest.AssertExistsAndLoadBean(t, &Issue{ID: 2}).(*Issue)
- user := unittest.AssertExistsAndLoadBean(t, &User{ID: 1}).(*User)
+ user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1}).(*user_model.User)
review, err := CreateReview(CreateReviewOptions{
Content: "New Review",
@@ -108,9 +109,9 @@ func TestGetReviewersByIssueID(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
issue := unittest.AssertExistsAndLoadBean(t, &Issue{ID: 3}).(*Issue)
- user2 := unittest.AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
- user3 := unittest.AssertExistsAndLoadBean(t, &User{ID: 3}).(*User)
- user4 := unittest.AssertExistsAndLoadBean(t, &User{ID: 4}).(*User)
+ user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}).(*user_model.User)
+ user3 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 3}).(*user_model.User)
+ user4 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 4}).(*user_model.User)
expectedReviews := []*Review{}
expectedReviews = append(expectedReviews,