We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 28c0c5e commit c84a556Copy full SHA for c84a556
1 file changed
tests.py
@@ -3,6 +3,7 @@
3
4
from __future__ import unicode_literals
5
6
+import json
7
import doctest
8
import unittest
9
import jsonpatch
@@ -192,6 +193,12 @@ def test_patch_neq_other_objs(self):
192
193
self.assertFalse(patch == p)
194
self.assertFalse(patch == None)
195
196
+ def test_str(self):
197
+ patch_obj = [ { "op": "add", "path": "/child", "value": { "grandchild": { } } } ]
198
+ patch = jsonpatch.JsonPatch(patch_obj)
199
+
200
+ self.assertEqual(json.dumps(patch_obj), str(patch))
201
+ self.assertEqual(json.dumps(patch_obj), patch.to_string())
202
203
204
0 commit comments