We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e56283 commit 901be4fCopy full SHA for 901be4f
demo/demo_chunkator/tests.py
@@ -58,6 +58,12 @@ def test_chunks_numqueries(self):
58
for item in chunks:
59
self.assertTrue(isinstance(item, Book))
60
61
+ # If the chunk size is bigger than the number of items, only one query.
62
+ with self.assertNumQueries(1):
63
+ chunks = chunkator(Book.objects.all(), 1000)
64
+ for item in chunks:
65
+ self.assertTrue(isinstance(item, Book))
66
+
67
68
class ChunkatorOrderTestCase(TestCase):
69
def setUp(self):
0 commit comments