File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 8
8
import pytest
9
9
10
10
11
- _cache = {}
11
+ _django_settings_is_configured = None
12
12
13
13
14
14
def skip_if_no_django ():
@@ -24,17 +24,17 @@ def django_settings_is_configured():
24
24
configured flag in the Django settings object if django.conf has already
25
25
been imported.
26
26
"""
27
- try :
28
- return _cache [ "django_is_configured" ]
29
- except KeyError :
27
+ global _django_settings_is_configured
28
+
29
+ if _django_settings_is_configured is None :
30
30
ret = bool (os .environ .get ("DJANGO_SETTINGS_MODULE" ))
31
31
32
32
if not ret and "django.conf" in sys .modules :
33
33
ret = sys .modules ["django.conf" ].settings .configured
34
34
35
- _cache [ "django_is_configured" ] = ret
35
+ _django_settings_is_configured = ret
36
36
37
- return ret
37
+ return _django_settings_is_configured
38
38
39
39
40
40
def get_django_version ():
You can’t perform that action at this time.
0 commit comments