Skip to content

Commit 145a837

Browse files
committed
Remove other warnings
1 parent 21b59b5 commit 145a837

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/test_forms_v2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33

44
import pytest
5+
from bson.json_util import RELAXED_JSON_OPTIONS
56
from werkzeug.datastructures import MultiDict
67

78
wtforms = 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 == {

tests/test_json_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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"])

0 commit comments

Comments
 (0)