-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix test_unique_user_username test and add invalid email test
.python-version is for pyenv
- Loading branch information
1 parent
d73d87e
commit 441924f
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,13 +196,23 @@ def test_post_generate_api_key_not_developer(self): | |
|
||
|
||
class RegisterTestCase(BaseTestCase): | ||
def test_unique_user_username(self): | ||
def test_invalid_email(self): | ||
data = dict( | ||
username="test", | ||
email="[email protected]", | ||
password="password", | ||
password_confirm="password", | ||
) | ||
response = self.client.post(url_for_security("register"), data=data) | ||
self.assertIn("Invalid email address", response.data.decode()) | ||
|
||
def test_unique_user_username(self): | ||
data = dict( | ||
username="test", | ||
email="[email protected]", | ||
password="password", | ||
password_confirm="password", | ||
) | ||
self.client.post(url_for_security("register"), data=data) | ||
response = self.client.post(url_for_security("register"), data=data) | ||
self.assertIn("Username already taken", response.data.decode()) |