diff --git a/InvenTree/InvenTree/tests.py b/InvenTree/InvenTree/tests.py index 52fb55cbf0..8b2f4c133a 100644 --- a/InvenTree/InvenTree/tests.py +++ b/InvenTree/InvenTree/tests.py @@ -453,8 +453,8 @@ class TestSettings(TestCase): # Create a user for auth user = get_user_model() - self.user = user.objects.create_superuser('testuser', 'test@testing.com', 'password') - self.client.login(username='testuser', password='password') + self.user = user.objects.create_superuser('testuser1', 'test1@testing.com', 'password1') + self.client.login(username='testuser1', password='password1') def run_reload(self): from plugin import registry @@ -472,29 +472,29 @@ class TestSettings(TestCase): # nothing set self.run_reload() - self.assertEqual(user_count(), 0) + self.assertEqual(user_count(), 1) # not enough set self.env.set('INVENTREE_ADMIN_USER', 'admin') # set username self.run_reload() - self.assertEqual(user_count(), 0) + self.assertEqual(user_count(), 1) # enough set self.env.set('INVENTREE_ADMIN_USER', 'admin') # set username self.env.set('INVENTREE_ADMIN_EMAIL', 'info@example.com') # set email self.env.set('INVENTREE_ADMIN_PASSWORD', 'password123') # set password self.run_reload() - self.assertEqual(user_count(), 1) + self.assertEqual(user_count(), 2) # create user manually self.user_mdl.objects.create_user('testuser', 'test@testing.com', 'password') - self.assertEqual(user_count(), 2) + self.assertEqual(user_count(), 3) # 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) + self.assertEqual(user_count(), 3) # make sure to clean up settings.TESTING_ENV = False