summaryrefslogtreecommitdiffstats
path: root/models/user/email_address_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/user/email_address_test.go')
-rw-r--r--models/user/email_address_test.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/models/user/email_address_test.go b/models/user/email_address_test.go
index 5ed0bf8884..642c2b3876 100644
--- a/models/user/email_address_test.go
+++ b/models/user/email_address_test.go
@@ -8,12 +8,13 @@ import (
"testing"
"code.gitea.io/gitea/models/db"
+ "code.gitea.io/gitea/models/unittest"
"github.com/stretchr/testify/assert"
)
func TestGetEmailAddresses(t *testing.T) {
- assert.NoError(t, db.PrepareTestDatabase())
+ assert.NoError(t, unittest.PrepareTestDatabase())
emails, _ := GetEmailAddresses(int64(1))
if assert.Len(t, emails, 3) {
@@ -30,7 +31,7 @@ func TestGetEmailAddresses(t *testing.T) {
}
func TestIsEmailUsed(t *testing.T) {
- assert.NoError(t, db.PrepareTestDatabase())
+ assert.NoError(t, unittest.PrepareTestDatabase())
isExist, _ := IsEmailUsed(db.DefaultContext, "")
assert.True(t, isExist)
@@ -41,7 +42,7 @@ func TestIsEmailUsed(t *testing.T) {
}
func TestAddEmailAddress(t *testing.T) {
- assert.NoError(t, db.PrepareTestDatabase())
+ assert.NoError(t, unittest.PrepareTestDatabase())
assert.NoError(t, AddEmailAddress(&EmailAddress{
Email: "user1234567890@example.com",
@@ -60,7 +61,7 @@ func TestAddEmailAddress(t *testing.T) {
}
func TestAddEmailAddresses(t *testing.T) {
- assert.NoError(t, db.PrepareTestDatabase())
+ assert.NoError(t, unittest.PrepareTestDatabase())
// insert multiple email address
emails := make([]*EmailAddress, 2)
@@ -83,7 +84,7 @@ func TestAddEmailAddresses(t *testing.T) {
}
func TestDeleteEmailAddress(t *testing.T) {
- assert.NoError(t, db.PrepareTestDatabase())
+ assert.NoError(t, unittest.PrepareTestDatabase())
assert.NoError(t, DeleteEmailAddress(&EmailAddress{
UID: int64(1),
@@ -108,7 +109,7 @@ func TestDeleteEmailAddress(t *testing.T) {
}
func TestDeleteEmailAddresses(t *testing.T) {
- assert.NoError(t, db.PrepareTestDatabase())
+ assert.NoError(t, unittest.PrepareTestDatabase())
// delete multiple email address
emails := make([]*EmailAddress, 2)