MCPcopy
hub / github.com/django/django / test_ticket7235_extra

Method test_ticket7235_extra

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

Source from the content-addressed store, hash-verified

905 self.assertSequenceEqual(q.only("meal"), [])
906
907 def test_ticket7235_extra(self):
908 Eaten.objects.create(meal="m")
909 q = Eaten.objects.none()
910 with self.assertNumQueries(0):
911 self.assertSequenceEqual(q.extra(select={"foo": "1"}), [])
912 q.query.low_mark = 1
913 msg = "Cannot change a query once a slice has been taken."
914 with self.assertRaisesMessage(TypeError, msg):
915 q.extra(select={"foo": "1"})
916
917 def test_ticket7791(self):
918 # There were "issues" when ordering and distinct-ing on fields related

Callers

nothing calls this directly

Calls 5

noneMethod · 0.80
assertNumQueriesMethod · 0.80
assertRaisesMessageMethod · 0.80
createMethod · 0.45
extraMethod · 0.45

Tested by

no test coverage detected