Skip to content

Commit

Permalink
fix: save querysetproxy sliced into a list
Browse files Browse the repository at this point in the history
  • Loading branch information
SepehrBazyar committed Aug 26, 2022
1 parent b195662 commit 7330d56
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/test_queries/test_pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 7330d56

Please sign in to comment.