Skip to content

Commit

Permalink
Migrated app_loading doctests.
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14427 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
freakboy3742 committed Nov 2, 2010
1 parent c10d41c commit 909c44e
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions tests/regressiontests/app_loading/tests.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,26 +7,23 @@
from django.db.models.loading import cache, load_app from django.db.models.loading import cache, load_app
from django.utils.unittest import TestCase from django.utils.unittest import TestCase


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


>>> old_sys_path = sys.path class InstalledAppsGlobbingTest(TestCase):
>>> sys.path.append(os.path.dirname(os.path.abspath(__file__))) def setUp(self):
self.OLD_SYS_PATH = sys.path
>>> old_tz = os.environ.get("TZ") sys.path.append(os.path.dirname(os.path.abspath(__file__)))
>>> settings = Settings('test_settings') self.OLD_TZ = os.environ.get("TZ")
>>> settings.INSTALLED_APPS
['parent.app', 'parent.app1', 'parent.app_2']


>>> 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. def tearDown(self):
>>> if hasattr(time, "tzset") and old_tz: sys.path = self.OLD_SYS_PATH
... os.environ["TZ"] = old_tz if hasattr(time, "tzset") and self.OLD_TZ:
... time.tzset() os.environ["TZ"] = self.OLD_TZ
time.tzset()


"""}


class EggLoadingTest(TestCase): class EggLoadingTest(TestCase):


Expand Down

0 comments on commit 909c44e

Please sign in to comment.