diff options
| author | Arthur Koziel <arthur@arthurkoziel.com> | 2010-06-22 21:19:14 +0000 |
|---|---|---|
| committer | Arthur Koziel <arthur@arthurkoziel.com> | 2010-06-22 21:19:14 +0000 |
| commit | 2b50fd810a0987475f6621e062dc956553f9d32c (patch) | |
| tree | a1e2bf0ad8d76372eda72dec2c038b4bb1322dbc /tests/regressiontests/app_loading | |
| parent | ff3c1c6e3ad37224ab72a1d5efc174a3c9c413d3 (diff) | |
rewrite app globbing doctest to unittest
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/app-loading@13387 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/app_loading')
| -rw-r--r-- | tests/regressiontests/app_loading/tests.py | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/tests/regressiontests/app_loading/tests.py b/tests/regressiontests/app_loading/tests.py index 111ed46925..dc860abe0e 100644 --- a/tests/regressiontests/app_loading/tests.py +++ b/tests/regressiontests/app_loading/tests.py @@ -7,26 +7,25 @@ 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. +class InstalledAppsGlobbingTest(TestCase): ->>> 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 + def setUp(self): + self.old_path = sys.path + sys.path.append(os.path.dirname(os.path.abspath(__file__))) + self.old_tz = os.environ.get("TZ") + self.settings = Settings('test_settings') -# 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_path + # Undo a side-effect of installing a new settings object. + if hasattr(time, "tzset") and self.old_tz: + os.environ["TZ"] = self.old_tz + time.tzset() -"""} + def test_globbing(self): + """Test the globbing of INSTALLED_APPS""" + self.assertEqual(self.settings.INSTALLED_APPS, + ['parent.app', 'parent.app1', 'parent.app_2']) class EggLoadingTest(TestCase): |
