예제 #1
0
def test_delete_single_failure():
    view = TestDataDetailRestView()
    view.object = Mock()
    view.object.delete.side_effect = Exception
    result = view.delete(None)
    view.object.delete.assert_called_once_with()
    assert_equal(result, False)
예제 #2
0
def test_delete_single():
    view = TestDataDetailRestView()
    view.object = Mock()
    result = view.delete(None)
    view.object.delete.assert_called_once_with()
    assert_equal(result, True)