Patch by Strum. Ticket #451 - Convert all mongokit style .find, .find_one, .one calls...
[mediagoblin.git] / mediagoblin / tests / tools.py
index 2584c62f89a08e9f0d7ba7b2b8ce12e667909e27..98361adc18eddf940882e1d06356171a561c9547 100644 (file)
@@ -164,7 +164,7 @@ def assert_db_meets_expected(db, expected):
     for collection_name, collection_data in expected.iteritems():
         collection = db[collection_name]
         for expected_document in collection_data:
-            document = collection.find_one({'id': expected_document['id']})
+            document = collection.query.filter_by(id=expected_document['id']).first()
             assert document is not None  # make sure it exists
             assert document == expected_document  # make sure it matches