summaryrefslogtreecommitdiffstats
path: root/integrations/pull_update_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-09-19 19:49:59 +0800
committerGitHub <noreply@github.com>2021-09-19 19:49:59 +0800
commita4bfef265d9e512830350635a0489c2cdcd6508f (patch)
tree1e3c2ec94276dfcb2f8ba73a2ac075ba39c4a34a /integrations/pull_update_test.go
parent462306e263db5a809dbe2cdf62e99307aeff28de (diff)
downloadgitea-a4bfef265d9e512830350635a0489c2cdcd6508f.tar.gz
gitea-a4bfef265d9e512830350635a0489c2cdcd6508f.zip
Move db related basic functions to models/db (#17075)
* Move db related basic functions to models/db * Fix lint * Fix lint * Fix test * Fix lint * Fix lint * revert unnecessary change * Fix test * Fix wrong replace string * Use *Context * Correct committer spelling and fix wrong replaced words Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'integrations/pull_update_test.go')
-rw-r--r--integrations/pull_update_test.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/integrations/pull_update_test.go b/integrations/pull_update_test.go
index 3e3b987b64..ea3a4794a6 100644
--- a/integrations/pull_update_test.go
+++ b/integrations/pull_update_test.go
@@ -11,6 +11,7 @@ import (
"time"
"code.gitea.io/gitea/models"
+ "code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/repofiles"
repo_module "code.gitea.io/gitea/modules/repository"
pull_service "code.gitea.io/gitea/services/pull"
@@ -22,8 +23,8 @@ import (
func TestAPIPullUpdate(t *testing.T) {
onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) {
//Create PR to test
- user := models.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User)
- org26 := models.AssertExistsAndLoadBean(t, &models.User{ID: 26}).(*models.User)
+ user := db.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User)
+ org26 := db.AssertExistsAndLoadBean(t, &models.User{ID: 26}).(*models.User)
pr := createOutdatedPR(t, user, org26)
//Test GetDiverging
@@ -50,8 +51,8 @@ func TestAPIPullUpdate(t *testing.T) {
func TestAPIPullUpdateByRebase(t *testing.T) {
onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) {
//Create PR to test
- user := models.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User)
- org26 := models.AssertExistsAndLoadBean(t, &models.User{ID: 26}).(*models.User)
+ user := db.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User)
+ org26 := db.AssertExistsAndLoadBean(t, &models.User{ID: 26}).(*models.User)
pr := createOutdatedPR(t, user, org26)
//Test GetDiverging
@@ -162,7 +163,7 @@ func createOutdatedPR(t *testing.T, actor, forkOrg *models.User) *models.PullReq
err = pull_service.NewPullRequest(baseRepo, pullIssue, nil, nil, pullRequest, nil)
assert.NoError(t, err)
- issue := models.AssertExistsAndLoadBean(t, &models.Issue{Title: "Test Pull -to-update-"}).(*models.Issue)
+ issue := db.AssertExistsAndLoadBean(t, &models.Issue{Title: "Test Pull -to-update-"}).(*models.Issue)
pr, err := models.GetPullRequestByIssueID(issue.ID)
assert.NoError(t, err)