Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #18964 -- floatformat test passes under py3k

Thanks Russell for the report.
  • Loading branch information...
commit b4420d96023b9d9067ebc8e8dcd8ca7cea41aff1 1 parent 58337b3
Aymeric Augustin authored October 28, 2012
13  tests/regressiontests/defaultfilters/tests.py
@@ -80,13 +80,16 @@ def __float__(self):
80 80
             decimal_ctx.prec = old_prec
81 81
 
82 82
 
83  
-    # This fails because of Python's float handling. Floats with many zeroes
84  
-    # after the decimal point should be passed in as another type such as
85  
-    # unicode or Decimal.
86  
-    @unittest.expectedFailure
87  
-    def test_floatformat_fail(self):
  83
+    def test_floatformat_py2_fail(self):
88 84
         self.assertEqual(floatformat(1.00000000000000015, 16), '1.0000000000000002')
89 85
 
  86
+    # The test above fails because of Python 2's float handling. Floats with
  87
+    # many zeroes after the decimal point should be passed in as another type
  88
+    # such as unicode or Decimal.
  89
+    if not six.PY3:
  90
+        test_floatformat_py2_fail = unittest.expectedFailure(test_floatformat_py2_fail)
  91
+
  92
+
90 93
     def test_addslashes(self):
91 94
         self.assertEqual(addslashes('"double quotes" and \'single quotes\''),
92 95
                           '\\"double quotes\\" and \\\'single quotes\\\'')

0 notes on commit b4420d9

Please sign in to comment.
Something went wrong with that request. Please try again.