1
0
mirror of https://github.com/django/django.git synced 2025-07-18 16:49:13 +00:00

[1.0.X] Fixed a few Python 2.3 incompatibilities that were causing test failures.

Backport of [10863] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10864 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Gary Wilson Jr 2009-05-29 05:28:40 +00:00
parent 0871c87b77
commit 53b0436102
2 changed files with 7 additions and 7 deletions

View File

@ -577,7 +577,7 @@ class BaseModelFormSet(BaseFormSet):
else: else:
return ugettext("Please correct the duplicate data for %(field)s, " return ugettext("Please correct the duplicate data for %(field)s, "
"which must be unique.") % { "which must be unique.") % {
"field": get_text_list(unique_check, _("and")), "field": get_text_list(unique_check, unicode(_("and"))),
} }
def get_date_error_message(self, date_check): def get_date_error_message(self, date_check):

View File

@ -161,9 +161,9 @@ class FileStoragePathParsing(TestCase):
self.storage.save('dotted.path/test', ContentFile("1")) self.storage.save('dotted.path/test', ContentFile("1"))
self.storage.save('dotted.path/test', ContentFile("2")) self.storage.save('dotted.path/test', ContentFile("2"))
self.assertFalse(os.path.exists(os.path.join(self.storage_dir, 'dotted_.path'))) self.failIf(os.path.exists(os.path.join(self.storage_dir, 'dotted_.path')))
self.assertTrue(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/test'))) self.assert_(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/test')))
self.assertTrue(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/test_'))) self.assert_(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/test_')))
def test_first_character_dot(self): def test_first_character_dot(self):
""" """
@ -173,13 +173,13 @@ class FileStoragePathParsing(TestCase):
self.storage.save('dotted.path/.test', ContentFile("1")) self.storage.save('dotted.path/.test', ContentFile("1"))
self.storage.save('dotted.path/.test', ContentFile("2")) self.storage.save('dotted.path/.test', ContentFile("2"))
self.assertTrue(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/.test'))) self.assert_(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/.test')))
# Before 2.6, a leading dot was treated as an extension, and so # Before 2.6, a leading dot was treated as an extension, and so
# underscore gets added to beginning instead of end. # underscore gets added to beginning instead of end.
if sys.version_info < (2, 6): if sys.version_info < (2, 6):
self.assertTrue(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/_.test'))) self.assert_(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/_.test')))
else: else:
self.assertTrue(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/.test_'))) self.assert_(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/.test_')))
if Image is not None: if Image is not None:
class DimensionClosingBug(TestCase): class DimensionClosingBug(TestCase):