summaryrefslogtreecommitdiff
path: root/tests/regressiontests/app_loading/tests.py
blob: a1273dfeb0f24e3a091d0fb8a9d85228f3441c68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
import sys
import time

from django.conf import Settings

__test__ = {"API_TESTS": """
Test the globbing of INSTALLED_APPS.

>>> old_sys_path = sys.path
>>> sys.path.append(os.path.dirname(os.path.abspath(__file__)))

>>> old_tz = os.environ.get("TZ")
>>> settings = Settings('test_settings')

>>> settings.INSTALLED_APPS
['parent.app', 'parent.app1', 'parent.app_2']

>>> sys.path = old_sys_path

# Undo a side-effect of installing a new settings object.
>>> if hasattr(time, "tzset") and old_tz:
...     os.environ["TZ"] = old_tz
...     time.tzset()

"""}