MCPcopy
hub / github.com/django/django / test_tickets_7698_10202

Method test_tickets_7698_10202

tests/queries/tests.py:2977–2984  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2975 Eaten.objects.create(meal="spam with eggs", food=food)
2976
2977 def test_tickets_7698_10202(self):
2978 # People like to slice with '0' as the high-water mark.
2979 self.assertSequenceEqual(Article.objects.all()[0:0], [])
2980 self.assertSequenceEqual(Article.objects.all()[0:0][:10], [])
2981 self.assertEqual(Article.objects.all()[:0].count(), 0)
2982 msg = "Cannot change a query once a slice has been taken."
2983 with self.assertRaisesMessage(TypeError, msg):
2984 Article.objects.all()[:0].latest("created")
2985
2986 def test_empty_resultset_sql(self):
2987 # ticket #12192

Callers

nothing calls this directly

Calls 4

assertRaisesMessageMethod · 0.80
latestMethod · 0.80
allMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected