Skip to content

Commit

Permalink
fix test_unique_user_username test and add invalid email test
Browse files Browse the repository at this point in the history
.python-version is for pyenv
  • Loading branch information
publicarray committed Feb 9, 2025
1 parent d73d87e commit 441924f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
12 changes: 11 additions & 1 deletion spkrepo/tests/test_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

0 comments on commit 441924f

Please sign in to comment.