summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-10-28 19:56:19 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-10-28 19:58:12 +0100
commit8d7e526229c27567860f7479dbce15d245742feb (patch)
tree3d331f95309f3a9ae09552d64a7a8adca9406bb0
parent88393357a6839fb4ce57793523bc25b17dc188a4 (diff)
[1.5.x] Fixed #18964 -- floatformat test passes under py3k
Thanks Russell for the report. Backport of b4420d9 from master.
-rw-r--r--tests/regressiontests/defaultfilters/tests.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/regressiontests/defaultfilters/tests.py b/tests/regressiontests/defaultfilters/tests.py
index bdf3c867c6..d00203e304 100644
--- a/tests/regressiontests/defaultfilters/tests.py
+++ b/tests/regressiontests/defaultfilters/tests.py
@@ -80,13 +80,16 @@ class DefaultFiltersTests(TestCase):
decimal_ctx.prec = old_prec
- # This fails because of Python's float handling. Floats with many zeroes
- # after the decimal point should be passed in as another type such as
- # unicode or Decimal.
- @unittest.expectedFailure
- def test_floatformat_fail(self):
+ def test_floatformat_py2_fail(self):
self.assertEqual(floatformat(1.00000000000000015, 16), '1.0000000000000002')
+ # The test above fails because of Python 2's float handling. Floats with
+ # many zeroes after the decimal point should be passed in as another type
+ # such as unicode or Decimal.
+ if not six.PY3:
+ test_floatformat_py2_fail = unittest.expectedFailure(test_floatformat_py2_fail)
+
+
def test_addslashes(self):
self.assertEqual(addslashes('"double quotes" and \'single quotes\''),
'\\"double quotes\\" and \\\'single quotes\\\'')