2009-03-10 05:51:06 +00:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import time
|
|
|
|
|
|
|
|
from django.conf import Settings
|
|
|
|
|
|
|
|
__test__ = {"API_TESTS": """
|
2009-03-08 09:39:48 +00:00
|
|
|
Test the globbing of INSTALLED_APPS.
|
|
|
|
|
|
|
|
>>> old_sys_path = sys.path
|
|
|
|
>>> sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
2010-02-03 18:09:11 +00:00
|
|
|
>>> old_tz = os.environ.get("TZ")
|
2009-03-10 05:51:06 +00:00
|
|
|
>>> settings = Settings('test_settings')
|
2009-03-08 09:39:48 +00:00
|
|
|
|
2009-03-10 05:51:06 +00:00
|
|
|
>>> settings.INSTALLED_APPS
|
2009-03-18 00:59:40 +00:00
|
|
|
['parent.app', 'parent.app1', 'parent.app_2']
|
2009-03-08 09:39:48 +00:00
|
|
|
|
|
|
|
>>> sys.path = old_sys_path
|
|
|
|
|
2009-03-10 05:51:06 +00:00
|
|
|
# Undo a side-effect of installing a new settings object.
|
2010-02-26 15:33:27 +00:00
|
|
|
>>> if hasattr(time, "tzset") and old_tz:
|
2009-03-10 05:51:06 +00:00
|
|
|
... os.environ["TZ"] = old_tz
|
|
|
|
... time.tzset()
|
|
|
|
|
|
|
|
"""}
|
2009-03-08 09:39:48 +00:00
|
|
|
|