use variable for values and up the all

This commit is contained in:
Matthias Mair 2022-05-20 19:57:13 +02:00
parent 9af0b981e7
commit 43f714b96c

View File

@ -501,14 +501,18 @@ class TestSettings(helpers.InvenTreeTestCase):
})
self.assertEqual(user_count(), 2)
username2 = 'testuser1'
email2 = 'test1@testing.com'
password2 = 'password1'
# create user manually
user_model.objects.create_user('testuser', 'test@testing.com', 'password')
user_model.objects.create_user(username2, email2, password2)
self.assertEqual(user_count(), 3)
# check it will not be created again
self.run_reload({
'INVENTREE_ADMIN_USER': 'testuser',
'INVENTREE_ADMIN_EMAIL': 'test@testing.com',
'INVENTREE_ADMIN_PASSWORD': 'password',
'INVENTREE_ADMIN_USER': username2,
'INVENTREE_ADMIN_EMAIL': email2,
'INVENTREE_ADMIN_PASSWORD': password2,
})
self.assertEqual(user_count(), 3)