Skip to content

Commit

Permalink
[1.5.x] Fixed #18964 -- floatformat test passes under py3k
Browse files Browse the repository at this point in the history
Thanks Russell for the report.

Backport of b4420d9 from master.
  • Loading branch information
aaugustin committed Oct 28, 2012
1 parent 8839335 commit 8d7e526
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/regressiontests/defaultfilters/tests.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -80,13 +80,16 @@ def __float__(self):
decimal_ctx.prec = old_prec decimal_ctx.prec = old_prec




# This fails because of Python's float handling. Floats with many zeroes def test_floatformat_py2_fail(self):
# after the decimal point should be passed in as another type such as
# unicode or Decimal.
@unittest.expectedFailure
def test_floatformat_fail(self):
self.assertEqual(floatformat(1.00000000000000015, 16), '1.0000000000000002') 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): def test_addslashes(self):
self.assertEqual(addslashes('"double quotes" and \'single quotes\''), self.assertEqual(addslashes('"double quotes" and \'single quotes\''),
'\\"double quotes\\" and \\\'single quotes\\\'') '\\"double quotes\\" and \\\'single quotes\\\'')
Expand Down

0 comments on commit 8d7e526

Please sign in to comment.