MCPcopy
hub / github.com/django/django / test_basic

Method test_basic

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

Source from the content-addressed store, hash-verified

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(

Callers

nothing calls this directly

Calls 3

NullIfClass · 0.90
values_listMethod · 0.80
annotateMethod · 0.80

Tested by

no test coverage detected