Fixed PATCHing comments
This commit is contained in:
@@ -105,6 +105,9 @@ class ValidateCustomFields(Validator):
|
|||||||
val = v.validate(value)
|
val = v.validate(value)
|
||||||
|
|
||||||
if val:
|
if val:
|
||||||
|
# This ensures the modifications made by v's coercion rules are
|
||||||
|
# visible to this validator's output.
|
||||||
|
self.current[field] = v.current
|
||||||
return True
|
return True
|
||||||
|
|
||||||
log.warning('Error validating properties for node %s: %s', self.document, v.errors)
|
log.warning('Error validating properties for node %s: %s', self.document, v.errors)
|
||||||
|
@@ -187,14 +187,14 @@ class EditCommentTest(AbstractPatchCommentTest):
|
|||||||
json={'op': 'edit', 'content': 'Je moeder is niet je vader.'},
|
json={'op': 'edit', 'content': 'Je moeder is niet je vader.'},
|
||||||
auth_token=token).json()
|
auth_token=token).json()
|
||||||
self.assertEqual('<p>Je moeder is niet je vader.</p>\n',
|
self.assertEqual('<p>Je moeder is niet je vader.</p>\n',
|
||||||
res['properties']['content_html'])
|
res['properties']['_content_html'])
|
||||||
|
|
||||||
# Get the node again, to inspect its changed state.
|
# Get the node again, to inspect its changed state.
|
||||||
patched_node = self.get(self.node_url, auth_token=token).json()
|
patched_node = self.get(self.node_url, auth_token=token).json()
|
||||||
self.assertEqual('Je moeder is niet je vader.',
|
self.assertEqual('Je moeder is niet je vader.',
|
||||||
patched_node['properties']['content'])
|
patched_node['properties']['content'])
|
||||||
self.assertEqual('<p>Je moeder is niet je vader.</p>\n',
|
self.assertEqual('<p>Je moeder is niet je vader.</p>\n',
|
||||||
patched_node['properties']['content_html'])
|
patched_node['properties']['_content_html'])
|
||||||
self.assertNotEqual(pre_node['_etag'], patched_node['_etag'])
|
self.assertNotEqual(pre_node['_etag'], patched_node['_etag'])
|
||||||
|
|
||||||
def test_comment_edit_other_user_admin(self):
|
def test_comment_edit_other_user_admin(self):
|
||||||
@@ -214,7 +214,7 @@ class EditCommentTest(AbstractPatchCommentTest):
|
|||||||
self.assertEqual('Purrrr kittycat',
|
self.assertEqual('Purrrr kittycat',
|
||||||
patched_node['properties']['content'])
|
patched_node['properties']['content'])
|
||||||
self.assertEqual('<p>Purrrr kittycat</p>\n',
|
self.assertEqual('<p>Purrrr kittycat</p>\n',
|
||||||
patched_node['properties']['content_html'])
|
patched_node['properties']['_content_html'])
|
||||||
|
|
||||||
def test_edit_noncomment_node(self):
|
def test_edit_noncomment_node(self):
|
||||||
url = '/api/nodes/%s' % self.asset_id
|
url = '/api/nodes/%s' % self.asset_id
|
||||||
|
Reference in New Issue
Block a user