Code

Ticket #16514: tests.diff

File tests.diff, 556 bytes (added by kman, 3 years ago)

Test to check if a number is nan

Line 
1diff -r 548df236b2cc tests/regressiontests/defaultfilters/tests.py
2--- a/tests/regressiontests/defaultfilters/tests.py     Sun Aug 21 18:09:08 2011 +0000
3+++ b/tests/regressiontests/defaultfilters/tests.py     Mon Aug 22 14:47:20 2011 +1000
4@@ -47,6 +47,10 @@
5         nan = pos_inf / pos_inf
6         self.assertEqual(floatformat(nan), unicode(nan))
7 
8+        #Test nan
9+        def test_isnan(self):
10+            self.assertTrue(math.isnan(nan))
11+
12         class FloatWrapper(object):
13             def __init__(self, value):
14                 self.value = value