MongoCollection.count() and update() are deprecated

Eve doesn't have any counting methods on `current_app.data`, so there is
no one-to-one translation for `cursor.count()` in
`file_storage/__init__.py`. Since the call was only used in a debug log
entry, I just removed it altogether.

I removed `pillar.cli.operations.index_users_rebuild()`, as it was
importing `pillar.api.utils.algolia.algolia_index_user_save` which doesn't
exist any more, so the code was dead anyway.
This commit is contained in:
2019-05-10 17:02:38 +02:00
parent 47d5c6cbad
commit 1e823a9dbe
13 changed files with 60 additions and 104 deletions

View File

@@ -24,13 +24,13 @@ class OrganizationCruTest(AbstractPillarTest):
self.enter_app_context()
# There should be no organizations to begin with.
db = self.app.db('organizations')
self.assertEqual(0, db.count())
org_coll = self.app.db('organizations')
self.assertEqual(0, org_coll.count_documents({}))
admin_uid = self.create_user(24 * 'a')
org_doc = self.app.org_manager.create_new_org('Хакеры', admin_uid, 25)
self.assertIsNotNone(db.find_one(org_doc['_id']))
self.assertIsNotNone(org_coll.find_one(org_doc['_id']))
self.assertEqual(bson.ObjectId(24 * 'a'), org_doc['admin_uid'])
self.assertEqual('Хакеры', org_doc['name'])
self.assertEqual(25, org_doc['seat_count'])