reformat with latest black
This commit is contained in:
parent
84f3dce492
commit
e64a7a9448
@ -11,7 +11,9 @@ PYMONGO_VERSION = tuple(pymongo.version_tuple[:2])
|
||||
IS_PYMONGO_GTE_37 = PYMONGO_VERSION >= _PYMONGO_37
|
||||
|
||||
|
||||
def count_documents(collection, filter, skip=None, limit=None, hint=None, collation=None):
|
||||
def count_documents(
|
||||
collection, filter, skip=None, limit=None, hint=None, collation=None
|
||||
):
|
||||
"""Pymongo>3.7 deprecates count in favour of count_documents
|
||||
"""
|
||||
if limit == 0:
|
||||
|
@ -404,7 +404,7 @@ class BaseQuerySet(object):
|
||||
|
||||
if self._limit == 0:
|
||||
# mimic the fact that historically .limit(0) sets no limit
|
||||
kwargs.pop('limit', None)
|
||||
kwargs.pop("limit", None)
|
||||
|
||||
if self._hint not in (-1, None):
|
||||
kwargs["hint"] = self._hint
|
||||
|
@ -554,7 +554,7 @@ class TestIndexes(unittest.TestCase):
|
||||
incorrect_collation = {"arndom": "wrdo"}
|
||||
with pytest.raises(OperationFailure) as exc_info:
|
||||
BlogPost.objects.collation(incorrect_collation).count()
|
||||
assert 'Missing expected field' in str(exc_info.value)
|
||||
assert "Missing expected field" in str(exc_info.value)
|
||||
|
||||
query_result = BlogPost.objects.collation({}).order_by("name")
|
||||
assert [x.name for x in query_result] == sorted(names)
|
||||
|
Loading…
x
Reference in New Issue
Block a user