MCPcopy
hub / github.com/django/django / test_raw_query_lazy

Method test_raw_query_lazy

tests/raw_query/tests.py:144–152  ·  view source on GitHub ↗

Raw queries are lazy: they aren't actually executed until they're iterated over.

(self)

Source from the content-addressed store, hash-verified

142 self.assertSuccessfulRawQuery(Author, query, authors)
143
144 def test_raw_query_lazy(self):
145 """
146 Raw queries are lazy: they aren't actually executed until they're
147 iterated over.
148 """
149 q = Author.objects.raw("SELECT * FROM raw_query_author")
150 self.assertIsNone(q.query.cursor)
151 list(q)
152 self.assertIsNotNone(q.query.cursor)
153
154 def test_FK_raw_query(self):
155 """

Callers

nothing calls this directly

Calls 1

rawMethod · 0.45

Tested by

no test coverage detected