Exemplo n.º 1
0
 def test_delete_service_action(self, delete):
     self.delete_service = tables.DeleteService()
     self.delete_service.table = mock.Mock()
     self.delete_service.table.kwargs.get.return_value = "test"
     self.delete_service.table.data = [{'?': {'id': 'service_id'}}]
     self.delete_service.action("", 'service_id')
     self.assertTrue(delete.called)
Exemplo n.º 2
0
 def test_delete_service_action_fail(self, exceptions, reverse):
     self.delete_service = tables.DeleteService()
     exceptions.handle.return_value = ""
     self.delete_service.action("", "")
     self.assertTrue(reverse.called)
Exemplo n.º 3
0
 def test_delete_service_is_allowed(self, status):
     self.delete_service = tables.DeleteService()
     status.return_value = 'test', 'test'
     self.assertTrue(self.delete_service.allowed("", ""))