| 1006 | ) |
| 1007 | |
| 1008 | def test_ticket7181(self): |
| 1009 | # Ordering by related tables should accommodate nullable fields (this |
| 1010 | # test is a little tricky, since NULL ordering is database dependent. |
| 1011 | # Instead, we just count the number of results). |
| 1012 | self.assertEqual(len(Tag.objects.order_by("parent__name")), 5) |
| 1013 | |
| 1014 | # Empty querysets can be merged with others. |
| 1015 | self.assertSequenceEqual( |
| 1016 | Note.objects.none() | Note.objects.all(), |
| 1017 | [self.n1, self.n2, self.n3], |
| 1018 | ) |
| 1019 | self.assertSequenceEqual( |
| 1020 | Note.objects.all() | Note.objects.none(), |
| 1021 | [self.n1, self.n2, self.n3], |
| 1022 | ) |
| 1023 | self.assertSequenceEqual(Note.objects.none() & Note.objects.all(), []) |
| 1024 | self.assertSequenceEqual(Note.objects.all() & Note.objects.none(), []) |
| 1025 | |
| 1026 | def test_ticket8439(self): |
| 1027 | # Complex combinations of conjunctions, disjunctions and nullable |