2.9. 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')
Read the Docs v: latest
Versions
latest
stable
v0.9.0
v0.8.8
v0.8.7
v0.8.6
v0.8.5
v0.8.1
v0.8.0
v0.7.10
v0.7.4
v0.7.3
v0.7.2
v0.7.1
0.7
v0.7rc1
Downloads
pdf
htmlzip
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.