Don't explicitly raise a TroveboxError if False is returned,
rely on frontend to issue an error code. This also means we don't need to test for this in unit tests.
This commit is contained in:
parent
6b3f010920
commit
bf437ffc7e
10 changed files with 20 additions and 133 deletions
|
@ -98,13 +98,6 @@ class TestActionDelete(TestActions):
|
|||
mock_post.assert_called_with("/action/1/delete.json", foo="bar")
|
||||
self.assertEqual(result, True)
|
||||
|
||||
@mock.patch.object(trovebox.Trovebox, 'post')
|
||||
def test_action_delete_failure(self, mock_post):
|
||||
"""Check that an exception is raised if an action cannot be deleted"""
|
||||
mock_post.return_value = self._return_value(False)
|
||||
with self.assertRaises(trovebox.TroveboxError):
|
||||
self.client.action.delete(self.test_actions[0])
|
||||
|
||||
@mock.patch.object(trovebox.Trovebox, 'post')
|
||||
def test_action_object_delete(self, mock_post):
|
||||
"""Check that an action can be deleted using the action object directly"""
|
||||
|
@ -116,16 +109,6 @@ class TestActionDelete(TestActions):
|
|||
self.assertEqual(action.get_fields(), {})
|
||||
self.assertEqual(action.id, None)
|
||||
|
||||
@mock.patch.object(trovebox.Trovebox, 'post')
|
||||
def test_action_object_delete_failure(self, mock_post):
|
||||
"""
|
||||
Check that an exception is raised if an action cannot be deleted
|
||||
when using the action object directly
|
||||
"""
|
||||
mock_post.return_value = self._return_value(False)
|
||||
with self.assertRaises(trovebox.TroveboxError):
|
||||
self.test_actions[0].delete()
|
||||
|
||||
class TestActionView(TestActions):
|
||||
@mock.patch.object(trovebox.Trovebox, 'get')
|
||||
def test_action_view(self, mock_get):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue