finalize code related to count_documents migration

This commit is contained in:
Bastien Gérard
2020-01-05 22:29:13 +01:00
parent f93f9406ee
commit 60c42dddd5
4 changed files with 31 additions and 30 deletions

View File

@@ -552,8 +552,9 @@ class TestIndexes(unittest.TestCase):
assert 5 == query_result.count()
incorrect_collation = {"arndom": "wrdo"}
with pytest.raises(OperationFailure):
with pytest.raises(OperationFailure) as exc_info:
BlogPost.objects.collation(incorrect_collation).count()
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)