mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
fix settings override?
This commit is contained in:
parent
b2676e3629
commit
d018654c9c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user