Fix compatibility with WebOb 1.6.0
THe new WebOb release got stricter on the way Response text can be retrieved for JSON responses. This fixes the issue by checking the body instead in tests. Change-Id: I45670bbebda9220ff3e69f10590d20dbc605f4a7
This commit is contained in:
parent
8a2d4b29d7
commit
cc45eeaf81
@ -164,8 +164,10 @@ class TestActionsController(base.FunctionalTest):
|
||||
)
|
||||
|
||||
self.assertEqual(400, resp.status_int)
|
||||
self.assertIn('Attempt to modify a system action: std.echo',
|
||||
resp.text)
|
||||
self.assertIn(
|
||||
'Attempt to modify a system action: std.echo',
|
||||
resp.body.decode()
|
||||
)
|
||||
|
||||
@mock.patch.object(db_api, "create_action_definition")
|
||||
def test_post(self, mock_mtd):
|
||||
@ -218,7 +220,7 @@ class TestActionsController(base.FunctionalTest):
|
||||
)
|
||||
|
||||
self.assertEqual(400, resp.status_int)
|
||||
self.assertIn("Scope must be one of the following", resp.text)
|
||||
self.assertIn("Scope must be one of the following", resp.body.decode())
|
||||
|
||||
@mock.patch.object(db_api, "create_action_definition", MOCK_DUPLICATE)
|
||||
def test_post_dup(self):
|
||||
|
@ -233,7 +233,10 @@ class TestWorkflowsController(base.FunctionalTest):
|
||||
)
|
||||
|
||||
self.assertEqual(400, resp.status_int)
|
||||
self.assertIn("Attempt to modify a system workflow", resp.text)
|
||||
self.assertIn(
|
||||
"Attempt to modify a system workflow",
|
||||
resp.body.decode()
|
||||
)
|
||||
|
||||
@mock.patch.object(db_api, "update_workflow_definition")
|
||||
def test_put_public(self, mock_update):
|
||||
@ -350,7 +353,7 @@ class TestWorkflowsController(base.FunctionalTest):
|
||||
)
|
||||
|
||||
self.assertEqual(400, resp.status_int)
|
||||
self.assertIn("Scope must be one of the following", resp.text)
|
||||
self.assertIn("Scope must be one of the following", resp.body.decode())
|
||||
|
||||
@mock.patch.object(db_api, "create_workflow_definition", MOCK_DUPLICATE)
|
||||
def test_post_dup(self):
|
||||
@ -389,7 +392,10 @@ class TestWorkflowsController(base.FunctionalTest):
|
||||
resp = self.app.delete('/v2/workflows/123', expect_errors=True)
|
||||
|
||||
self.assertEqual(400, resp.status_int)
|
||||
self.assertIn("Attempt to delete a system workflow", resp.text)
|
||||
self.assertIn(
|
||||
"Attempt to delete a system workflow",
|
||||
resp.body.decode()
|
||||
)
|
||||
|
||||
@mock.patch.object(db_api, "delete_workflow_definition", MOCK_NOT_FOUND)
|
||||
def test_delete_not_found(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user