MCPcopy
hub / github.com/django/django / test_ignores_null

Method test_ignores_null

tests/db_functions/comparison/test_least.py:25–31  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

23
24 @skipUnlessDBFeature("greatest_least_ignores_nulls")
25 def test_ignores_null(self):
26 now = timezone.now()
27 Article.objects.create(title="Testing with Django", written=now)
28 articles = Article.objects.annotate(
29 first_updated=Least("written", "published"),
30 )
31 self.assertEqual(articles.first().first_updated, now)
32
33 @skipIfDBFeature("greatest_least_ignores_nulls")
34 def test_propagates_null(self):

Callers

nothing calls this directly

Calls 5

LeastClass · 0.90
annotateMethod · 0.80
firstMethod · 0.80
nowMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected