add test for user creation

This commit is contained in:
Matthias 2022-05-11 22:02:41 +02:00
parent 86f663e834
commit 8366620c1d
No known key found for this signature in database
GPG Key ID: AB6D0E6C4CB65093

View File

@ -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