Return an empty MongoDB page for a zero result limit
This commit is contained in:
parent
d06e982b46
commit
63825de2f9
1 changed files with 10 additions and 0 deletions
|
|
@ -30,3 +30,11 @@ def test_mongo_date_bounds_match_stored_iso_strings(
|
|||
predicates = collection.find.call_args.kwargs["filter"]["$and"]
|
||||
assert {"created": {"$gte": "2026-01-01T00:00:00"}} in predicates
|
||||
assert {"created": {"$lte": "2026-01-02T00:00:00"}} in predicates
|
||||
|
||||
|
||||
def test_zero_take_preserves_count_without_fetching(
|
||||
mongo: Tuple[MongoDbDriver, Any],
|
||||
) -> None:
|
||||
driver, collection = mongo
|
||||
assert driver.query(take=0) == ([], 3)
|
||||
collection.find.assert_not_called()
|
||||
|
|
|
|||
Loading…
Reference in a new issue