mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
add test for user creation
This commit is contained in:
parent
86f663e834
commit
8366620c1d
@ -481,6 +481,16 @@ class TestSettings(TestCase):
|
||||
self.run_reload()
|
||||
self.assertEqual(user_count(), 1)
|
||||
|
||||
# create user manually
|
||||
self.user_mdl.objects.create_user('testuser', 'test@testing.com', 'password')
|
||||
self.assertEqual(user_count(), 2)
|
||||
# check it will not be created again
|
||||
self.env.set('INVENTREE_ADMIN_USER', 'testuser')
|
||||
self.env.set('INVENTREE_ADMIN_EMAIL', 'test@testing.com')
|
||||
self.env.set('INVENTREE_ADMIN_PASSWORD', 'password')
|
||||
self.run_reload()
|
||||
self.assertEqual(user_count(), 2)
|
||||
|
||||
# make sure to clean up
|
||||
settings.TESTING_ENV = False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user