mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-01 04:56:45 +00:00
fix settings override?
This commit is contained in:
parent
b2676e3629
commit
d018654c9c
@ -2,7 +2,7 @@
|
|||||||
import json
|
import json
|
||||||
from test.support import EnvironmentVarGuard
|
from test.support import EnvironmentVarGuard
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase, override_settings
|
||||||
import django.core.exceptions as django_exceptions
|
import django.core.exceptions as django_exceptions
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
@ -429,11 +429,10 @@ class TestSettings(TestCase):
|
|||||||
settings.USER_ADDED = False
|
settings.USER_ADDED = False
|
||||||
registry.reload_plugins()
|
registry.reload_plugins()
|
||||||
|
|
||||||
|
@override_settings(TESTING_ENV=True)
|
||||||
def test_set_user_to_few(self):
|
def test_set_user_to_few(self):
|
||||||
# add shortcut
|
# add shortcut
|
||||||
user_count = self.user_mdl.objects.count
|
user_count = self.user_mdl.objects.count
|
||||||
# enable testing mode
|
|
||||||
settings.TESTING_ENV = True
|
|
||||||
|
|
||||||
# nothing set
|
# nothing set
|
||||||
self.assertEqual(user_count(), 0)
|
self.assertEqual(user_count(), 0)
|
||||||
@ -457,6 +456,3 @@ class TestSettings(TestCase):
|
|||||||
with self.assertRaises(IntegrationPluginError):
|
with self.assertRaises(IntegrationPluginError):
|
||||||
self.run_reload()
|
self.run_reload()
|
||||||
self.assertEqual(user_count(), 1)
|
self.assertEqual(user_count(), 1)
|
||||||
|
|
||||||
# make sure to clean up
|
|
||||||
settings.TESTING_ENV = False
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user