From 8366620c1d3ee4d21510a43c560c7d9fdd61985b Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 11 May 2022 22:02:41 +0200 Subject: [PATCH] add test for user creation --- InvenTree/InvenTree/tests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/InvenTree/InvenTree/tests.py b/InvenTree/InvenTree/tests.py index dc3aff85e6..707960cb28 100644 --- a/InvenTree/InvenTree/tests.py +++ b/InvenTree/InvenTree/tests.py @@ -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