diff options
Diffstat (limited to 'mediagoblin/tests/tools.py')
-rw-r--r-- | mediagoblin/tests/tools.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mediagoblin/tests/tools.py b/mediagoblin/tests/tools.py index d3369831..8c09c7ec 100644 --- a/mediagoblin/tests/tools.py +++ b/mediagoblin/tests/tools.py @@ -184,20 +184,20 @@ def assert_db_meets_expected(db, expected): """ Assert a database contains the things we expect it to. - Objects are found via '_id', so you should make sure your document - has an _id. + Objects are found via 'id', so you should make sure your document + has an id. Args: - db: pymongo or mongokit database connection - expected: the data we expect. Formatted like: {'collection_name': [ - {'_id': 'foo', + {'id': 'foo', 'some_field': 'some_value'},]} """ 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.find_one({'id': expected_document['id']}) assert document is not None # make sure it exists assert document == expected_document # make sure it matches |