def delete(self): try: if 'id' in request.args: item = ProviderModel.delete(request.args['id']) return "success", 201 return "No ID", 401 except: return "error", 401
def test_delete_provider(self): providers = len(ProviderModel.list()) provider = ProviderModel.delete(2) assert providers - 1 == len(ProviderModel.list())