MCPcopy
hub / github.com/django/django / test_null_argument

Method test_null_argument

tests/db_functions/comparison/test_nullif.py:35–39  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

33 )
34
35 def test_null_argument(self):
36 authors = Author.objects.annotate(
37 nullif=NullIf("name", Value(None))
38 ).values_list("nullif")
39 self.assertCountEqual(authors, [("John Smith",), ("Rhonda",)])
40
41 def test_too_few_args(self):
42 msg = "'NullIf' takes exactly 2 arguments (1 given)"

Callers

nothing calls this directly

Calls 4

NullIfClass · 0.90
ValueClass · 0.90
values_listMethod · 0.80
annotateMethod · 0.80

Tested by

no test coverage detected