summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2010-04-27 15:01:54 +0000
committerKaren Tracey <kmtracey@gmail.com>2010-04-27 15:01:54 +0000
commit5f1ecdc51ab9a55e8155fae9026783ab76c9c8c2 (patch)
tree67964a4c39292c047f878008f42c2e54fd397164
parent33f097e50b83bff669643f76ab4ab3c4316d77d8 (diff)
Python 2.3 compatibility: Fixed a test to only run under 2.4+, since it fails due to a Ptyhon problem under 2.3.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@13032 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--tests/regressiontests/admin_scripts/tests.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py
index 7b82bd408d..66076be8bc 100644
--- a/tests/regressiontests/admin_scripts/tests.py
+++ b/tests/regressiontests/admin_scripts/tests.py
@@ -531,7 +531,7 @@ class DjangoAdminSettingsDirectory(AdminScriptTestCase):
A series of tests for django-admin.py when the settings file is in a
directory. (see #9751).
"""
-
+
def setUp(self):
self.write_settings('settings', is_dir=True)
@@ -973,10 +973,15 @@ class ManageValidate(AdminScriptTestCase):
def test_broken_app(self):
"manage.py validate reports an ImportError if an app's models.py raises one on import"
self.write_settings('settings.py', apps=['admin_scripts.broken_app'])
- args = ['validate']
- out, err = self.run_manage(args)
- self.assertNoOutput(out)
- self.assertOutput(err, 'ImportError')
+ # Skip this test on Python 2.3, where a 2nd attempt to import a broken module won't raise
+ # an error. Due to the way models modules are loaded and re-tried if the first attempt
+ # fails, Django needs the 2nd attempt to fail, but on Python 2.3 that does not happen, thus
+ # this function only works on higher levels of Python.
+ if sys.version_info >= (2, 4):
+ args = ['validate']
+ out, err = self.run_manage(args)
+ self.assertNoOutput(out)
+ self.assertOutput(err, 'ImportError')
def test_complex_app(self):
"manage.py validate does not raise an ImportError validating a complex app with nested calls to load_app"