Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed a bunch of Python 2.3 test failures.

All remaining buildbot failures on 2.3 are not due to the test suite, as far as
I can work out.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8055 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c5a76a366970dc1305bb638ed6bd070d0a86376c 1 parent d1ea8b2
@malcolmt malcolmt authored
View
6 tests/regressiontests/admin_scripts/tests.py
@@ -6,6 +6,7 @@
import os
import unittest
import shutil
+import sys
from django import conf, bin, get_version
from django.conf import settings
@@ -737,7 +738,10 @@ def test_help(self):
"--help is handled as a special case"
args = ['--help']
out, err = self.run_manage(args)
- self.assertOutput(out, "Usage: manage.py [options]")
+ if sys.version_info < (2, 4):
+ self.assertOutput(out, "usage: manage.py [options]")
+ else:
+ self.assertOutput(out, "Usage: manage.py [options]")
self.assertOutput(err, "Type 'manage.py help <subcommand>' for help on a specific subcommand.")
def test_specific_help(self):
View
8 tests/regressiontests/admin_views/tests.py
@@ -102,7 +102,7 @@ def testLogin(self):
self.failUnlessEqual(request.status_code, 200)
login = self.client.post('/test_admin/admin/', self.super_login)
self.assertRedirects(login, '/test_admin/admin/')
- self.assertFalse(login.context)
+ self.failIf(login.context)
self.client.get('/test_admin/admin/logout/')
# Test if user enters e-mail address
@@ -124,7 +124,7 @@ def testLogin(self):
self.failUnlessEqual(request.status_code, 200)
login = self.client.post('/test_admin/admin/', self.adduser_login)
self.assertRedirects(login, '/test_admin/admin/')
- self.assertFalse(login.context)
+ self.failIf(login.context)
self.client.get('/test_admin/admin/logout/')
# Change User
@@ -132,7 +132,7 @@ def testLogin(self):
self.failUnlessEqual(request.status_code, 200)
login = self.client.post('/test_admin/admin/', self.changeuser_login)
self.assertRedirects(login, '/test_admin/admin/')
- self.assertFalse(login.context)
+ self.failIf(login.context)
self.client.get('/test_admin/admin/logout/')
# Delete User
@@ -140,7 +140,7 @@ def testLogin(self):
self.failUnlessEqual(request.status_code, 200)
login = self.client.post('/test_admin/admin/', self.deleteuser_login)
self.assertRedirects(login, '/test_admin/admin/')
- self.assertFalse(login.context)
+ self.failIf(login.context)
self.client.get('/test_admin/admin/logout/')
# Regular User should not be able to login.
View
7 tests/regressiontests/utils/tests.py
@@ -11,6 +11,13 @@
import itercompat
from decorators import DecoratorFromMiddlewareTests
+# We need this because "datastructures" uses sorted() and the tests are run in
+# the scope of this module.
+try:
+ sorted
+except NameError:
+ from django.utils.itercompat import sorted # For Python 2.3
+
# Extra tests
__test__ = {
'timesince': timesince,
Please sign in to comment.
Something went wrong with that request. Please try again.