Commits

Hynek Cernoch committed e2f6afd

Fixed test: explicite skipping and removed dependency on DJANGO_SETTINGS_MODULE.

Comments (0)

Files changed (1)

 
 class ExampleApplication(TestCase):
 
-    #def setUp(self):
-    #    pass
-
     def test_get_homepage(self):
-        if settings.DJANGO_SETTINGS_MODULE == 'app_plugins.test_app.settings':
+        if getattr(settings, 'DJANGO_SETTINGS_MODULE', '') == 'app_plugins.test_app.settings':
             c = Client()
             response = c.get('/')
             self.assertContains(response, 'site plugin text here')
             self.assertContains(response, 'someapp plugin text here')
         else:
-            pass   # test skipped without special settings.py
+            if hasattr(self, 'skipTest'):
+                self.skipTest('This requires running from demo project directory app_plugins/test_app for simplicity')