Skip to content

Commit 901be4f

Browse files
committed
dummy test on large chunks
1 parent 4e56283 commit 901be4f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

demo/demo_chunkator/tests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ def test_chunks_numqueries(self):
5858
for item in chunks:
5959
self.assertTrue(isinstance(item, Book))
6060

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+
6167

6268
class ChunkatorOrderTestCase(TestCase):
6369
def setUp(self):

0 commit comments

Comments
 (0)