(self)
| 15 | Author.objects.create(name="Rhonda", alias="Rhonda") |
| 16 | |
| 17 | def test_basic(self): |
| 18 | authors = Author.objects.annotate(nullif=NullIf("alias", "name")).values_list( |
| 19 | "nullif" |
| 20 | ) |
| 21 | self.assertCountEqual( |
| 22 | authors, |
| 23 | [ |
| 24 | ("smithj",), |
| 25 | ( |
| 26 | ( |
| 27 | "" |
| 28 | if connection.features.interprets_empty_strings_as_nulls |
| 29 | else None |
| 30 | ), |
| 31 | ), |
| 32 | ], |
| 33 | ) |
| 34 | |
| 35 | def test_null_argument(self): |
| 36 | authors = Author.objects.annotate( |
nothing calls this directly
no test coverage detected