summaryrefslogtreecommitdiffstats
path: root/models/pull_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-01-28 00:11:41 +0800
committerGitHub <noreply@github.com>2017-01-28 00:11:41 +0800
commitbb5a6b7a07125b29604f479f45e59073cb3d4648 (patch)
tree590eeb774f6cb16bc8f8b12dc8f92fb6fd11b443 /models/pull_test.go
parent25663b58161c48bdc8e9cae900544378dede0d2b (diff)
downloadgitea-bb5a6b7a07125b29604f479f45e59073cb3d4648.tar.gz
gitea-bb5a6b7a07125b29604f479f45e59073cb3d4648.zip
fix xorm NewSession uncorrected usages (#774)
Diffstat (limited to 'models/pull_test.go')
-rw-r--r--models/pull_test.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/models/pull_test.go b/models/pull_test.go
index f0352be35e..b8794e1311 100644
--- a/models/pull_test.go
+++ b/models/pull_test.go
@@ -225,11 +225,9 @@ func TestChangeUsernameInPullRequests(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
const newUsername = "newusername"
assert.NoError(t, ChangeUsernameInPullRequests("user1", newUsername))
- sess := x.NewSession()
- defer sess.Close()
prs := make([]*PullRequest, 0, 10)
- assert.NoError(t, sess.Where("head_user_name = ?", newUsername).Find(&prs))
+ assert.NoError(t, x.Where("head_user_name = ?", newUsername).Find(&prs))
assert.Len(t, prs, 2)
for _, pr := range prs {
assert.Equal(t, newUsername, pr.HeadUserName)