mirror of
https://github.com/cve-search/PyVulnerabilityLookup.git
synced 2025-01-18 02:26:19 +00:00
chg: Used .local TLD and added the test test_create_user_not_allowed_login.
This commit is contained in:
parent
6ceb31de7d
commit
920f76cf17
1 changed files with 13 additions and 1 deletions
|
@ -260,6 +260,18 @@ class TestPublic(unittest.TestCase):
|
|||
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
|
||||
|
@ -299,7 +311,7 @@ class TestPublic(unittest.TestCase):
|
|||
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']
|
||||
|
|
Loading…
Add table
Reference in a new issue