MCPcopy
hub / github.com/django/django / test_no_chunked_reads

Method test_no_chunked_reads

tests/queries/test_iterator.py:48–58  ·  view source on GitHub ↗

If the database backend doesn't support chunked reads, then the result of SQLCompiler.execute_sql() is a list.

(self)

Source from the content-addressed store, hash-verified

46 self.assertEqual(mock_args[self.itersize_index_in_mock_args], batch_size)
47
48 def test_no_chunked_reads(self):
49 """
50 If the database backend doesn't support chunked reads, then the
51 result of SQLCompiler.execute_sql() is a list.
52 """
53 qs = Article.objects.all()
54 compiler = qs.query.get_compiler(using=qs.db)
55 features = connections[qs.db].features
56 with mock.patch.object(features, "can_use_chunked_reads", False):
57 result = compiler.execute_sql(chunked_fetch=True)
58 self.assertIsInstance(result, list)

Callers

nothing calls this directly

Calls 3

get_compilerMethod · 0.80
allMethod · 0.45
execute_sqlMethod · 0.45

Tested by

no test coverage detected