From d018654c9ce53c0db4b28fa71c8396f3b0bdfd73 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 2 Mar 2022 00:17:00 +0100 Subject: [PATCH] fix settings override? --- InvenTree/InvenTree/tests.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/InvenTree/InvenTree/tests.py b/InvenTree/InvenTree/tests.py index cd6986e8d0..c31dad4d95 100644 --- a/InvenTree/InvenTree/tests.py +++ b/InvenTree/InvenTree/tests.py @@ -2,7 +2,7 @@ import json from test.support import EnvironmentVarGuard -from django.test import TestCase +from django.test import TestCase, override_settings import django.core.exceptions as django_exceptions from django.core.exceptions import ValidationError from django.contrib.auth import get_user_model @@ -429,11 +429,10 @@ class TestSettings(TestCase): settings.USER_ADDED = False registry.reload_plugins() + @override_settings(TESTING_ENV=True) def test_set_user_to_few(self): # add shortcut user_count = self.user_mdl.objects.count - # enable testing mode - settings.TESTING_ENV = True # nothing set self.assertEqual(user_count(), 0) @@ -457,6 +456,3 @@ class TestSettings(TestCase): with self.assertRaises(IntegrationPluginError): self.run_reload() self.assertEqual(user_count(), 1) - - # make sure to clean up - settings.TESTING_ENV = False