Skip to content

Commit

Permalink
chg: Used .local TLD and added the test test_create_user_not_allowed_…
Browse files Browse the repository at this point in the history
…login.
  • Loading branch information
cedricbonhomme committed Nov 25, 2024
1 parent 6ceb31d commit 920f76c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,18 @@ def test_bundles_local(self) -> None:
self.assertTrue(len(comments["data"]) == 0)

# Test User
def test_create_user_not_allowed_login(self) -> None:
if self.public_test:
# Do not run that test against the public instance, it would create users.
return None
instance_config = self.client.get_config_info()
if not instance_config.get('registration'):
return None
for login in ["login", "user", "username", "help", "test", "about", "administration", "account"]:
user = self.client.create_user(name='test Name', login=login,
organisation='test Organization', email='test@testorg.local')
self.assertEqual(user['message'], 'Username not allowed.')

def test_users_info(self) -> None:
if not self.admin_token:
# this test is only working if the admin token is set
Expand Down Expand Up @@ -299,7 +311,7 @@ def test_create_user_comment(self) -> None:
return None

user = self.client.create_user(name='test Name', login='alan',
organisation='test Organization', email='test@testorg.lu')
organisation='test Organization', email='test@testorg.local')
self.assertTrue(user)
self.assertTrue('id' in user, user)
uid = user['id']
Expand Down

0 comments on commit 920f76c

Please sign in to comment.