From 8713ea7568af8871bf1306f14cc928058df0d4c7 Mon Sep 17 00:00:00 2001 From: Josh Smeaton Date: Wed, 7 Jan 2015 21:30:25 +1100 Subject: Fixed null handling in Value expression --- tests/annotations/tests.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/annotations') diff --git a/tests/annotations/tests.py b/tests/annotations/tests.py index 570ef4d52c..90a9c13048 100644 --- a/tests/annotations/tests.py +++ b/tests/annotations/tests.py @@ -190,6 +190,13 @@ class NonAggregateAnnotationTestCase(TestCase): lambda d: (d.other_name, d.other_chain, d.is_open, d.book_isbn) ) + def test_null_annotation(self): + """ + Test that annotating None onto a model round-trips + """ + book = Book.objects.annotate(no_value=Value(None, output_field=IntegerField())).first() + self.assertIsNone(book.no_value) + def test_column_field_ordering(self): """ Test that columns are aligned in the correct order for -- cgit v1.3