Lookup.can_use_none_as_rhs=True allows None as a lookup value.
(self)
| 1661 | self.assertCountEqual(authors, result) |
| 1662 | |
| 1663 | def test_custom_lookup_none_rhs(self): |
| 1664 | """Lookup.can_use_none_as_rhs=True allows None as a lookup value.""" |
| 1665 | season = Season.objects.create(year=2012, nulled_text_field=None) |
| 1666 | query = Season.objects.get_queryset().query |
| 1667 | field = query.model._meta.get_field("nulled_text_field") |
| 1668 | self.assertIsInstance( |
| 1669 | query.build_lookup(["isnull_none_rhs"], field, None), IsNullWithNoneAsRHS |
| 1670 | ) |
| 1671 | self.assertTrue( |
| 1672 | Season.objects.filter(pk=season.pk, nulled_text_field__isnull_none_rhs=True) |
| 1673 | ) |
| 1674 | |
| 1675 | def test_exact_exists(self): |
| 1676 | qs = Article.objects.filter(pk=OuterRef("pk")) |
nothing calls this directly
no test coverage detected