def _delete_using_service(channel, extension_id): from xivo_dao.data_handler.extension import services as extension_services try: extension = extension_services.get(extension_id) except LookupError: return extension_services.delete(extension)
def test_delete(self, validate_delete, extension_dao_delete, extension_notifier_deleted): exten = 'extension' context = 'toto' extension = Extension(id=1, exten=exten, context=context) extension_services.delete(extension) validate_delete.assert_called_once_with(extension) extension_dao_delete.assert_called_once_with(extension) extension_notifier_deleted.assert_called_once_with(extension)
def delete(extensionid): extension = extension_services.get(extensionid) extension_services.delete(extension) return make_response('', 204)