Author: russellm
Date: 2010-08-23 21:26:14 -0500 (Mon, 23 Aug 2010)
New Revision: 13636

Modified:
   django/trunk/tests/regressiontests/forms/fields.py
Log:
Fixed #14159 -- Corrected more potential uses of relative paths in tests. 
Thanks to Alex Gaynor for the patch.

Modified: django/trunk/tests/regressiontests/forms/fields.py
===================================================================
--- django/trunk/tests/regressiontests/forms/fields.py  2010-08-24 01:03:51 UTC 
(rev 13635)
+++ django/trunk/tests/regressiontests/forms/fields.py  2010-08-24 02:26:14 UTC 
(rev 13636)
@@ -766,13 +766,13 @@
     # FilePathField 
###############################################################
 
     def test_filepathfield_65(self):
-        path = forms.__file__
+        path = os.path.abspath(forms.__file__)
         path = os.path.dirname(path) + '/'
-        assert fix_os_paths(path).endswith('/django/forms/')
+        self.assertTrue(fix_os_paths(path).endswith('/django/forms/'))
 
     def test_filepathfield_66(self):
         path = forms.__file__
-        path = os.path.dirname(path) + '/'
+        path = os.path.dirname(os.path.abspath(path)) + '/'
         f = FilePathField(path=path)
         f.choices = [p for p in f.choices if p[0].endswith('.py')]
         f.choices.sort()
@@ -787,13 +787,13 @@
             ]
         for exp, got in zip(expected, fix_os_paths(f.choices)):
             self.assertEqual(exp[1], got[1])
-            assert got[0].endswith(exp[0])
+            self.assertTrue(got[0].endswith(exp[0]))
         self.assertRaisesErrorWithMessage(ValidationError, "[u'Select a valid 
choice. fields.py is not one of the available choices.']", f.clean, 'fields.py')
         assert fix_os_paths(f.clean(path + 
'fields.py')).endswith('/django/forms/fields.py')
 
     def test_filepathfield_67(self):
         path = forms.__file__
-        path = os.path.dirname(path) + '/'
+        path = os.path.dirname(os.path.abspath(path)) + '/'
         f = FilePathField(path=path, match='^.*?\.py$')
         f.choices.sort()
         expected = [
@@ -807,10 +807,10 @@
             ]
         for exp, got in zip(expected, fix_os_paths(f.choices)):
             self.assertEqual(exp[1], got[1])
-            assert got[0].endswith(exp[0])
+            self.assertTrue(got[0].endswith(exp[0]))
 
     def test_filepathfield_68(self):
-        path = forms.__file__
+        path = os.path.abspath(forms.__file__)
         path = os.path.dirname(path) + '/'
         f = FilePathField(path=path, recursive=True, match='^.*?\.py$')
         f.choices.sort()
@@ -827,7 +827,7 @@
             ]
         for exp, got in zip(expected, fix_os_paths(f.choices)):
             self.assertEqual(exp[1], got[1])
-            assert got[0].endswith(exp[0])
+            self.assertTrue(got[0].endswith(exp[0]))
 
     # SplitDateTimeField 
##########################################################
 

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

Reply via email to