Author: gwilson
Date: 2009-05-29 00:28:40 -0500 (Fri, 29 May 2009)
New Revision: 10864

Modified:
   django/branches/releases/1.0.X/django/forms/models.py
   django/branches/releases/1.0.X/tests/regressiontests/file_storage/tests.py
Log:
[1.0.X] Fixed a few Python 2.3 incompatibilities that were causing test 
failures.

Backport of [10863] from trunk.


Modified: django/branches/releases/1.0.X/django/forms/models.py
===================================================================
--- django/branches/releases/1.0.X/django/forms/models.py       2009-05-29 
05:23:50 UTC (rev 10863)
+++ django/branches/releases/1.0.X/django/forms/models.py       2009-05-29 
05:28:40 UTC (rev 10864)
@@ -577,7 +577,7 @@
         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):

Modified: 
django/branches/releases/1.0.X/tests/regressiontests/file_storage/tests.py
===================================================================
--- django/branches/releases/1.0.X/tests/regressiontests/file_storage/tests.py  
2009-05-29 05:23:50 UTC (rev 10863)
+++ django/branches/releases/1.0.X/tests/regressiontests/file_storage/tests.py  
2009-05-29 05:28:40 UTC (rev 10864)
@@ -161,9 +161,9 @@
         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):
         """
@@ -173,13 +173,13 @@
         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):


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to