diff options
Diffstat (limited to 'models/user_test.go')
-rw-r--r-- | models/user_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/models/user_test.go b/models/user_test.go index 7a6f5aa512..216cd44c59 100644 --- a/models/user_test.go +++ b/models/user_test.go @@ -329,6 +329,21 @@ func TestCreateUser(t *testing.T) { assert.NoError(t, DeleteUser(user)) } +func TestCreateUserInvalidEmail(t *testing.T) { + user := &User{ + Name: "GiteaBot", + Email: "GiteaBot@gitea.io\r\n", + Passwd: ";p['////..-++']", + IsAdmin: false, + Theme: setting.UI.DefaultTheme, + MustChangePassword: false, + } + + err := CreateUser(user) + assert.Error(t, err) + assert.True(t, IsErrEmailInvalid(err)) +} + func TestCreateUser_Issue5882(t *testing.T) { // Init settings |