Skip to content

Commit

Permalink
add test count with limit
Browse files Browse the repository at this point in the history
  • Loading branch information
CAPITAINMARVEL committed Oct 7, 2024
1 parent 37844f0 commit e747cc1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/odm/documents/test_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ async def test_count_with_filter_query(documents):
await documents(1, "cuatro", True)
c = await DocumentTestModel.find_many({"test_str": "dos"}).count()
assert c == 2


async def test_count_with_limit(documents):
await documents(4, "uno", True)
await documents(2, "dos", True)
await documents(1, "cuatro", True)
c = await DocumentTestModel.find_many().limit(1).count()
assert c == 1
d = await DocumentTestModel.find_many().count()
assert d == 3

0 comments on commit e747cc1

Please sign in to comment.