Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 573 Bytes

mongomock.rst

File metadata and controls

21 lines (14 loc) · 573 Bytes

Use mongomock for testing

mongomock is a package to do just what the name implies, mocking a mongo database.

To use with mongoengine, simply specify mongomock when connecting with mongoengine:

connect('mongoenginetest', host='mongomock://localhost')
conn = get_connection()

or with an alias:

connect('mongoenginetest', host='mongomock://localhost', alias='testdb')
conn = get_connection('testdb')