diff -r dd4af7c313f5 django/conf/__init__.py
a
|
b
|
|
58 | 58 | configured = property(configured) |
59 | 59 | |
60 | 60 | class Settings(object): |
61 | | def __init__(self, settings_module): |
| 61 | def __init__(self, settings_module, modify_global_state=True): |
62 | 62 | # update this dict from global settings (but only for ALL_CAPS settings) |
63 | 63 | for setting in dir(global_settings): |
64 | 64 | if setting == setting.upper(): |
… |
… |
|
98 | 98 | new_installed_apps.append(app) |
99 | 99 | self.INSTALLED_APPS = new_installed_apps |
100 | 100 | |
101 | | if hasattr(time, 'tzset'): |
| 101 | if modify_global_state and hasattr(time, 'tzset'): |
102 | 102 | # Move the time zone info into os.environ. See ticket #2315 for why |
103 | 103 | # we don't do this unconditionally (breaks Windows). |
104 | 104 | os.environ['TZ'] = self.TIME_ZONE |
diff -r dd4af7c313f5 tests/regressiontests/app_loading/tests.py
a
|
b
|
|
7 | 7 | |
8 | 8 | >>> from django.conf import Settings |
9 | 9 | |
10 | | >>> s = Settings('test_settings') |
| 10 | >>> s = Settings('test_settings', modify_global_state=False) |
11 | 11 | |
12 | 12 | >>> s.INSTALLED_APPS |
13 | 13 | ['parent.app', 'parent.app1'] |