diff options
| author | Markus Holtermann <info@markusholtermann.eu> | 2014-11-06 12:29:43 +0100 |
|---|---|---|
| committer | Baptiste Mispelon <bmispelon@gmail.com> | 2014-11-06 15:30:30 +0100 |
| commit | c7c098cf97fbb1416f302c76799058ad63a5f7aa (patch) | |
| tree | f2999e18d173ecf17161b1b61578b284f2607c79 /tests | |
| parent | b07aa52e8a8e4c7fdc7265f75ce2e7992e657ae9 (diff) | |
Fixed #23770 -- Changed serialization strategy for floats with respect to NaN and Inf
Thanks to w0rp for the report
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_writer.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/migrations/test_writer.py b/tests/migrations/test_writer.py index f98b2493aa..1dcc8e641a 100644 --- a/tests/migrations/test_writer.py +++ b/tests/migrations/test_writer.py @@ -2,6 +2,7 @@ from __future__ import unicode_literals import datetime +import math import os import re import tokenize @@ -69,6 +70,10 @@ class WriterTests(TestCase): """ # Basic values self.assertSerializedEqual(1) + self.assertSerializedEqual(1.2) + self.assertTrue(math.isinf(self.serialize_round_trip(float("inf")))) + self.assertTrue(math.isinf(self.serialize_round_trip(float("-inf")))) + self.assertTrue(math.isnan(self.serialize_round_trip(float("nan")))) self.assertSerializedEqual(None) self.assertSerializedEqual(b"foobar") string, imports = MigrationWriter.serialize(b"foobar") |
