summaryrefslogtreecommitdiffstats
path: root/integrations/api_comment_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrations/api_comment_test.go')
-rw-r--r--integrations/api_comment_test.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/integrations/api_comment_test.go b/integrations/api_comment_test.go
index cf26fa0e16..9ab97c0f40 100644
--- a/integrations/api_comment_test.go
+++ b/integrations/api_comment_test.go
@@ -12,6 +12,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/unittest"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/convert"
api "code.gitea.io/gitea/modules/structs"
@@ -25,7 +26,7 @@ func TestAPIListRepoComments(t *testing.T) {
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
- repoOwner := unittest.AssertExistsAndLoadBean(t, &models.User{ID: repo.OwnerID}).(*models.User)
+ repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
session := loginUser(t, repoOwner.Name)
link, _ := url.Parse(fmt.Sprintf("/api/v1/repos/%s/%s/issues/comments", repoOwner.Name, repo.Name))
@@ -71,7 +72,7 @@ func TestAPIListIssueComments(t *testing.T) {
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
- repoOwner := unittest.AssertExistsAndLoadBean(t, &models.User{ID: repo.OwnerID}).(*models.User)
+ repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
session := loginUser(t, repoOwner.Name)
req := NewRequestf(t, "GET", "/api/v1/repos/%s/%s/issues/%d/comments",
@@ -91,7 +92,7 @@ func TestAPICreateComment(t *testing.T) {
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{}).(*models.Issue)
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
- repoOwner := unittest.AssertExistsAndLoadBean(t, &models.User{ID: repo.OwnerID}).(*models.User)
+ repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
session := loginUser(t, repoOwner.Name)
token := getTokenForLoggedInUser(t, session)
@@ -114,7 +115,7 @@ func TestAPIGetComment(t *testing.T) {
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{ID: 2}).(*models.Comment)
assert.NoError(t, comment.LoadIssue())
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: comment.Issue.RepoID}).(*models.Repository)
- repoOwner := unittest.AssertExistsAndLoadBean(t, &models.User{ID: repo.OwnerID}).(*models.User)
+ repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
session := loginUser(t, repoOwner.Name)
token := getTokenForLoggedInUser(t, session)
@@ -143,7 +144,7 @@ func TestAPIEditComment(t *testing.T) {
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
- repoOwner := unittest.AssertExistsAndLoadBean(t, &models.User{ID: repo.OwnerID}).(*models.User)
+ repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
session := loginUser(t, repoOwner.Name)
token := getTokenForLoggedInUser(t, session)
@@ -168,7 +169,7 @@ func TestAPIDeleteComment(t *testing.T) {
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
- repoOwner := unittest.AssertExistsAndLoadBean(t, &models.User{ID: repo.OwnerID}).(*models.User)
+ repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
session := loginUser(t, repoOwner.Name)
token := getTokenForLoggedInUser(t, session)