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 22import json
33
44import pytest
5+ from bson .json_util import RELAXED_JSON_OPTIONS
56from werkzeug .datastructures import MultiDict
67
78wtforms = pytest .importorskip ("wtforms" )
@@ -129,7 +130,7 @@ class AllFieldsModel(db.Document):
129130 form .save ()
130131
131132 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 ))
133134 object_dict .pop ("_id" )
134135
135136 assert object_dict == {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def as_pymongo():
1818 @app .route ("/aggregate" )
1919 def aggregate ():
2020 return flask .jsonify (
21- result = Todo .objects ().aggregate ({"$match" : {"title" : {"$ne" : "lksdjh" }}})
21+ result = Todo .objects ().aggregate ([ {"$match" : {"title" : {"$ne" : "lksdjh" }}}] )
2222 )
2323
2424 @app .route ("/add" , methods = ["POST" ])
You can’t perform that action at this time.
0 commit comments