Ticket #26215: 26215-test2.diff

File 26215-test2.diff, 812 bytes (added by Tim Graham, 4 years ago)
  • tests/postgres_tests/test_ranges.py

    diff --git a/tests/postgres_tests/test_ranges.py b/tests/postgres_tests/test_ranges.py
    index dd676f9..8e2f596 100644
    a b class TestSerialization(PostgreSQLTestCase): 
    309309        self.assertEqual(instance.dates, DateRange(self.lower_date, self.upper_date))
    310310        self.assertEqual(instance.timestamps, DateTimeTZRange(self.lower_dt, self.upper_dt))
    311311
     312    def test_serialize_range_with_null(self):
     313        instance = RangesModel(ints=NumericRange(None, 10))
     314        data = serializers.serialize('json', [instance])
     315        new_instance = list(serializers.deserialize('json', data))[0].object
     316        self.assertEqual(new_instance.ints, NumericRange(None, 10))
     317
    312318
    313319class TestValidators(PostgreSQLTestCase):
    314320
Back to Top