File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 2
2
import json
3
3
4
4
import pytest
5
+ from bson .json_util import RELAXED_JSON_OPTIONS
5
6
from werkzeug .datastructures import MultiDict
6
7
7
8
wtforms = pytest .importorskip ("wtforms" )
@@ -129,7 +130,7 @@ class AllFieldsModel(db.Document):
129
130
form .save ()
130
131
131
132
obj = AllFieldsModel .objects .get (id = form .instance .pk )
132
- object_dict = json .loads (obj .to_json ())
133
+ object_dict = json .loads (obj .to_json (json_options = RELAXED_JSON_OPTIONS ))
133
134
object_dict .pop ("_id" )
134
135
135
136
assert object_dict == {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def as_pymongo():
18
18
@app .route ("/aggregate" )
19
19
def aggregate ():
20
20
return flask .jsonify (
21
- result = Todo .objects ().aggregate ({"$match" : {"title" : {"$ne" : "lksdjh" }}})
21
+ result = Todo .objects ().aggregate ([ {"$match" : {"title" : {"$ne" : "lksdjh" }}}] )
22
22
)
23
23
24
24
@app .route ("/add" , methods = ["POST" ])
You can’t perform that action at this time.
0 commit comments