Author: mtredinnick
Date: 2007-09-14 04:55:17 -0500 (Fri, 14 Sep 2007)
New Revision: 6183

Modified:
   django/trunk/django/contrib/localflavor/br/forms.py
   django/trunk/tests/modeltests/test_client/models.py
   django/trunk/tests/regressiontests/test_client_regress/models.py
   django/trunk/tests/runtests.py
Log:
Fixed a bunch of Python 2.3 issues. Two tests still fail, but this fixes the 
bulk of things.


Modified: django/trunk/django/contrib/localflavor/br/forms.py
===================================================================
--- django/trunk/django/contrib/localflavor/br/forms.py 2007-09-14 08:49:02 UTC 
(rev 6182)
+++ django/trunk/django/contrib/localflavor/br/forms.py 2007-09-14 09:55:17 UTC 
(rev 6183)
@@ -9,6 +9,11 @@
 from django.utils.translation import ugettext as _
 import re
 
+try:
+    set
+except NameError:
+    from sets import Set as set     # For Python 2.3
+
 phone_digits_re = re.compile(r'^(\d{2})[-\.]?(\d{4})[-\.]?(\d{4})$')
 
 class BRZipCodeField(RegexField):

Modified: django/trunk/tests/modeltests/test_client/models.py
===================================================================
--- django/trunk/tests/modeltests/test_client/models.py 2007-09-14 08:49:02 UTC 
(rev 6182)
+++ django/trunk/tests/modeltests/test_client/models.py 2007-09-14 09:55:17 UTC 
(rev 6183)
@@ -243,7 +243,7 @@
         
         # Log in
         login = self.client.login(username='testclient', password='password')
-        self.assertTrue(login, 'Could not log in')
+        self.failUnless(login, 'Could not log in')
 
         # Request a page that requires a login
         response = self.client.get('/test_client/login_protected_view/')

Modified: django/trunk/tests/regressiontests/test_client_regress/models.py
===================================================================
--- django/trunk/tests/regressiontests/test_client_regress/models.py    
2007-09-14 08:49:02 UTC (rev 6182)
+++ django/trunk/tests/regressiontests/test_client_regress/models.py    
2007-09-14 09:55:17 UTC (rev 6183)
@@ -252,7 +252,7 @@
         # Create a second client, and log in.
         c = Client()
         login = c.login(username='testclient', password='password')
-        self.assertTrue(login, 'Could not log in')
+        self.failUnless(login, 'Could not log in')
 
         # Get a redirection page with the second client.
         response = c.get("/test_client_regress/login_protected_redirect_view/")

Modified: django/trunk/tests/runtests.py
===================================================================
--- django/trunk/tests/runtests.py      2007-09-14 08:49:02 UTC (rev 6182)
+++ django/trunk/tests/runtests.py      2007-09-14 09:55:17 UTC (rev 6183)
@@ -4,6 +4,13 @@
 import unittest
 
 import django.contrib as contrib
+
+try:
+    set
+except NameError:
+    from sets import Set as set     # For Python 2.3
+
+
 CONTRIB_DIR_NAME = 'django.contrib'
 MODEL_TESTS_DIR_NAME = 'modeltests'
 REGRESSION_TESTS_DIR_NAME = 'regressiontests'


--~--~---------~--~----~------------~-------~--~----~
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