If the database backend doesn't support chunked reads, then the result of SQLCompiler.execute_sql() is a list.
(self)
| 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) |
nothing calls this directly
no test coverage detected