This commit is contained in:
Matthias Mair 2022-03-01 20:12:38 +01:00 committed by GitHub
parent 56e0b5f98d
commit 0957feafa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -439,21 +439,21 @@ class TestSettings(TestCase):
self.assertEqual(user_count(), 0)
# not enough set
self.env.set('INVENTREE_SET_USER', 'admin') # set username
self.env.set('INVENTREE_ADMIN_USER', 'admin') # set username
self.run_reload()
self.assertEqual(user_count(), 0)
# enough set
self.env.set('INVENTREE_SET_USER', 'admin') # set username
self.env.set('INVENTREE_SET_EMAIL', 'info@example.com') # set email
self.env.set('INVENTREE_SET_PASSWORD', 'password123') # set password
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)
# double adding should not work
self.env.set('INVENTREE_SET_USER', 'admin') # set username
self.env.set('INVENTREE_SET_EMAIL', 'info@example.com') # set email
self.env.set('INVENTREE_SET_PASSWORD', 'password123') # set password
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
with self.assertRaises(IntegrationPluginError):
self.run_reload()
self.assertEqual(user_count(), 1)