File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -13,3 +13,4 @@ User Guide
13
13
gridfs
14
14
signals
15
15
text-indexes
16
+ mongomock
Original file line number Diff line number Diff line change
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)
You can’t perform that action at this time.
0 commit comments