Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Migrated app_loading doctests.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14427 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 909c44e1aa8c216e748ef85d27ab8b686fe61d46 1 parent c10d41c
Russell Keith-Magee authored November 02, 2010

Showing 1 changed file with 13 additions and 16 deletions. Show diff stats Hide diff stats

  1. 29  tests/regressiontests/app_loading/tests.py
29  tests/regressiontests/app_loading/tests.py
@@ -7,26 +7,23 @@
7 7
 from django.db.models.loading import cache, load_app
8 8
 from django.utils.unittest import TestCase
9 9
 
10  
-__test__ = {"API_TESTS": """
11  
-Test the globbing of INSTALLED_APPS.
12 10
 
13  
->>> old_sys_path = sys.path
14  
->>> sys.path.append(os.path.dirname(os.path.abspath(__file__)))
15  
-
16  
->>> old_tz = os.environ.get("TZ")
17  
->>> settings = Settings('test_settings')
18  
-
19  
->>> settings.INSTALLED_APPS
20  
-['parent.app', 'parent.app1', 'parent.app_2']
  11
+class InstalledAppsGlobbingTest(TestCase):
  12
+    def setUp(self):
  13
+        self.OLD_SYS_PATH = sys.path
  14
+        sys.path.append(os.path.dirname(os.path.abspath(__file__)))
  15
+        self.OLD_TZ = os.environ.get("TZ")
21 16
 
22  
->>> sys.path = old_sys_path
  17
+    def test_globbing(self):
  18
+        settings = Settings('test_settings')
  19
+        self.assertEquals(settings.INSTALLED_APPS, ['parent.app', 'parent.app1', 'parent.app_2'])
23 20
 
24  
-# Undo a side-effect of installing a new settings object.
25  
->>> if hasattr(time, "tzset") and old_tz:
26  
-...     os.environ["TZ"] = old_tz
27  
-...     time.tzset()
  21
+    def tearDown(self):
  22
+        sys.path = self.OLD_SYS_PATH
  23
+        if hasattr(time, "tzset") and self.OLD_TZ:
  24
+            os.environ["TZ"] = self.OLD_TZ
  25
+            time.tzset()
28 26
 
29  
-"""}
30 27
 
31 28
 class EggLoadingTest(TestCase):
32 29
 

0 notes on commit 909c44e

Please sign in to comment.
Something went wrong with that request. Please try again.