fix settings override?

This commit is contained in:
Matthias 2022-03-02 00:17:00 +01:00
parent b2676e3629
commit d018654c9c
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -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