Use self.assertRaises as context manager
This commit is contained in:
@@ -52,8 +52,8 @@ class NodeContentTypeTest(AbstractPillarTest):
|
|||||||
self.assertNotIn('content_type', db_node['properties'])
|
self.assertNotIn('content_type', db_node['properties'])
|
||||||
|
|
||||||
# PUT it again, without a file -- should be blocked.
|
# PUT it again, without a file -- should be blocked.
|
||||||
self.assertRaises(UnprocessableEntity, self.app.put_internal, 'nodes', node_doc,
|
with self.assertRaises(UnprocessableEntity):
|
||||||
_id=node_id)
|
self.app.put_internal('nodes', node_doc, _id=node_id)
|
||||||
|
|
||||||
# PUT it with a file.
|
# PUT it with a file.
|
||||||
node_doc['properties']['file'] = str(file_id)
|
node_doc['properties']['file'] = str(file_id)
|
||||||
|
Reference in New Issue
Block a user