diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-11-02 05:23:44 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-11-02 05:23:44 +0000 |
| commit | 3cfde8364be4f12e59e77dcd656e394236681ea8 (patch) | |
| tree | d5ead24dfd9e6d2305669fcb1c3b9d194020f55a | |
| parent | 628be3497a4c5a480f8564d782cbbd8f1f9879d7 (diff) | |
[1.2.X] Migrated app_loading doctests.
Backport of r14427 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14428 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | tests/regressiontests/app_loading/tests.py | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/tests/regressiontests/app_loading/tests.py b/tests/regressiontests/app_loading/tests.py index 111ed46925..d43cfafaac 100644 --- a/tests/regressiontests/app_loading/tests.py +++ b/tests/regressiontests/app_loading/tests.py @@ -7,26 +7,23 @@ from unittest import TestCase from django.conf import Settings from django.db.models.loading import cache, load_app -__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'] +class InstalledAppsGlobbingTest(TestCase): + def setUp(self): + self.OLD_SYS_PATH = sys.path + sys.path.append(os.path.dirname(os.path.abspath(__file__))) + self.OLD_TZ = os.environ.get("TZ") ->>> sys.path = old_sys_path + def test_globbing(self): + settings = Settings('test_settings') + self.assertEquals(settings.INSTALLED_APPS, ['parent.app', 'parent.app1', 'parent.app_2']) -# Undo a side-effect of installing a new settings object. ->>> if hasattr(time, "tzset") and old_tz: -... os.environ["TZ"] = old_tz -... time.tzset() + def tearDown(self): + sys.path = self.OLD_SYS_PATH + if hasattr(time, "tzset") and self.OLD_TZ: + os.environ["TZ"] = self.OLD_TZ + time.tzset() -"""} class EggLoadingTest(TestCase): |
