From 7330d56505e0d3c4574b05e463ce1f596fa61e13 Mon Sep 17 00:00:00 2001 From: Sepehr Date: Sat, 27 Aug 2022 00:23:33 +0430 Subject: [PATCH] fix: save querysetproxy sliced into a list --- tests/test_queries/test_pagination.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/test_queries/test_pagination.py b/tests/test_queries/test_pagination.py index c873fca14..7f8ac61d5 100644 --- a/tests/test_queries/test_pagination.py +++ b/tests/test_queries/test_pagination.py @@ -180,16 +180,16 @@ async def test_slice_getitem_queryset_on_proxy(): c = await Car(name=f"{i}").save() await user.cars.add(c) - user.cars[:5] - assert len(user.cars) == 5 - assert user.cars[0].name == "0" - assert user.cars[4].name == "4" + cars_page1 = user.cars[:5] + assert len(cars_page1) == 5 + assert cars_page1[0].name == "0" + assert cars_page1[4].name == "4" - user.cars[5:10] - assert len(user.cars) == 5 - assert user.cars[0].name == "5" - assert user.cars[4].name == "9" + cars_page2 = user.cars[5:10] + assert len(cars_page2) == 5 + assert cars_page2[0].name == "5" + assert cars_page2[4].name == "9" - user.cars[10:] - assert len(user.cars) == 10 - assert user.cars[0].name == "10" + cars_page3 = user.cars[10:] + assert len(cars_page3) == 10 + assert cars_page3[0].name == "10"