You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the unit test of this repository is using osolete method, in soon version it might stop working
tests/test__mongomock.py::InsertedDocumentTest::test__remove_by_id
./mongomock/tests/test__mongomock.py:3649: DeprecationWarning: remove is deprecated. Use delete_one or delete_many instead.
self.collection.remove(self.object_id)
tests/test__mongomock.py::InsertedDocumentTest::test__remove_by_id
./tests/test__mongomock.py:3650: DeprecationWarning: count is deprecated. Use estimated_document_count or count_documents instead. Please note that $where must be replaced by $expr, $near must be replaced by $geoWithin with $center, and $nearSphere must be replaced by $geoWithin with $centerSphere
self.assertEqual(0, self.collection.count())
tests/test__mongomock.py::DatabasesNamesTest::test__database_names
./mongomock/tests/test__mongomock.py:3690: DeprecationWarning: insert is deprecated. Use insert_one or insert_many instead.
self.client.unit.tests.insert({'foo': 'bar'})
tests/test__mongomock.py::DatabasesNamesTest::test__database_names
./mongomock/tests/test__mongomock.py:3691: DeprecationWarning: insert is deprecated. Use insert_one or insert_many instead.
self.client.foo.bar.insert({'unit': 'test'})
tests/test__mongomock.py::DatabasesNamesTest::test__database_names
tests/test__patch.py::PatchTest::test__decorator
./mongomock/mongomock/mongo_client.py:112: UserWarning: database_names is deprecated. Use list_database_names instead.
warnings.warn('database_names is deprecated. Use list_database_names instead.')
Activity
pcorpet commentedon Oct 3, 2020
Note that we want to keep some of them as we want to copy
pymongobehavior. Oncepymongoremoves them we will stop using and testing them.However for now those are used in many places even when they are not tested so I'll clean it up a bit.
Stop using obsolete methods in unit tests as much as possible.
ankostis commentedon Mar 23, 2023
But does
estimated_document_count()collection-method work?ankostis commentedon Mar 23, 2023
Indeed it works. Forgive my eventual spam.
Stop using obsolete methods in unit tests as much as possible.