Skip to content

Commit

Permalink
[1.0.X] Fixed a few Python 2.3 incompatibilities that were causing te…
Browse files Browse the repository at this point in the history
…st 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
  • Loading branch information
gdub committed May 29, 2009
1 parent 0871c87 commit 53b0436
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion django/forms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def get_unique_error_message(self, unique_check):
else:
return ugettext("Please correct the duplicate data for %(field)s, "
"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):
Expand Down
12 changes: 6 additions & 6 deletions tests/regressiontests/file_storage/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ def test_directory_with_dot(self):
self.storage.save('dotted.path/test', ContentFile("1"))
self.storage.save('dotted.path/test', ContentFile("2"))

self.assertFalse(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.assertTrue(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/test_')))
self.failIf(os.path.exists(os.path.join(self.storage_dir, 'dotted_.path')))
self.assert_(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):
"""
Expand All @@ -173,13 +173,13 @@ def test_first_character_dot(self):
self.storage.save('dotted.path/.test', ContentFile("1"))
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
# underscore gets added to beginning instead of end.
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:
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:
class DimensionClosingBug(TestCase):
Expand Down

0 comments on commit 53b0436

Please sign in to comment.