MCPcopy
hub / github.com/django/django / test_none

Method test_none

tests/lookup/tests.py:1065–1078  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1063 )
1064
1065 def test_none(self):
1066 # none() returns a QuerySet that behaves like any other QuerySet object
1067 self.assertSequenceEqual(Article.objects.none(), [])
1068 self.assertSequenceEqual(
1069 Article.objects.none().filter(headline__startswith="Article"), []
1070 )
1071 self.assertSequenceEqual(
1072 Article.objects.filter(headline__startswith="Article").none(), []
1073 )
1074 self.assertEqual(Article.objects.none().count(), 0)
1075 self.assertEqual(
1076 Article.objects.none().update(headline="This should not take effect"), 0
1077 )
1078 self.assertSequenceEqual(list(Article.objects.none().iterator()), [])
1079
1080 def test_in(self):
1081 self.assertSequenceEqual(

Callers

nothing calls this directly

Calls 5

noneMethod · 0.80
filterMethod · 0.45
countMethod · 0.45
updateMethod · 0.45
iteratorMethod · 0.45

Tested by

no test coverage detected