File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,8 @@ use_parentheses = true
123123addopts = " --cov=flask_mongoengine --cov-config=setup.cfg"
124124testpaths = [" tests" ]
125125filterwarnings = [
126+ " error" ,
127+ " ignore::ResourceWarning" ,
126128 " ignore::DeprecationWarning:flask_mongoengine" ,
127129 " ignore::DeprecationWarning:tests" ,
128130 ]
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" )
@@ -160,7 +161,7 @@ class AllFieldsModel(db.Document):
160161 form .save ()
161162
162163 obj = AllFieldsModel .objects .get (id = form .instance .pk )
163- object_dict = json .loads (obj .to_json ())
164+ object_dict = json .loads (obj .to_json (json_options = RELAXED_JSON_OPTIONS ))
164165 object_dict .pop ("_id" )
165166
166167 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