Ticket #26215: 26215-test.diff

File 26215-test.diff, 944 bytes (added by Tim Graham, 9 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..55c4778 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_dumping_null(self):
     313        instance = RangesModel(ints=None, floats=None, timestamps=None, dates=None)
     314        data = serializers.serialize('json', [instance])
     315        new_instance = list(serializers.deserialize('json', data))[0].object
     316        self.assertIsNone(new_instance.ints)
     317        self.assertIsNone(new_instance.floats)
     318        self.assertIsNone(new_instance.bigints)
     319        self.assertIsNone(new_instance.dates)
     320
    312321
    313322class TestValidators(PostgreSQLTestCase):
    314323
Back to Top