Skip to content

Commit 2dd70c8

Browse files
author
Omer Katz
committed
Merge pull request #1180 from moonso/add-mongomock-docs
Added page for documenting mongomock. Updated docs/guide/index.rst
2 parents 713af13 + a388670 commit 2dd70c8

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

docs/guide/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ User Guide
1313
gridfs
1414
signals
1515
text-indexes
16+
mongomock

docs/guide/mongomock.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
==============================
2+
Use mongomock for testing
3+
==============================
4+
5+
`mongomock <https://github.com/vmalloc/mongomock/>`_ is a package to do just
6+
what the name implies, mocking a mongo database.
7+
8+
To use with mongoengine, simply specify mongomock when connecting with
9+
mongoengine:
10+
11+
.. code-block:: python
12+
13+
connect('mongoenginetest', host='mongomock://localhost')
14+
conn = get_connection()
15+
16+
or with an alias:
17+
18+
.. code-block:: python
19+
20+
connect('mongoenginetest', host='mongomock://localhost', alias='testdb')
21+
conn = get_connection('testdb)

0 commit comments

Comments
 (0)