def test_delete_access_denied( mock_raise_for_dashboard_access, client, dashboard_id: int ): login(client, "admin") mock_raise_for_dashboard_access.side_effect = DashboardAccessDeniedError() resp = client.delete(f"api/v1/dashboard/{dashboard_id}/filter_state/{KEY}") assert resp.status_code == 403
def test_delete_not_owner(client, chart_id: int, dataset_id: int, admin_id: int): another_key = "another_key" another_owner = admin_id + 1 entry: TemporaryExploreState = { "owner": another_owner, "dataset_id": dataset_id, "chart_id": chart_id, "form_data": INITIAL_FORM_DATA, } cache_manager.explore_form_data_cache.set(another_key, entry) login(client, "admin") resp = client.delete(f"api/v1/explore/form_data/{another_key}") assert resp.status_code == 403
def test_delete_access_denied(client): login(client, "gamma") resp = client.delete(f"api/v1/explore/form_data/{KEY}") assert resp.status_code == 404
def test_delete(client): login(client, "admin") resp = client.delete(f"api/v1/explore/form_data/{KEY}") assert resp.status_code == 200
def test_delete_not_owner(client, dashboard_id: int): login(client, "gamma") resp = client.delete(f"api/v1/dashboard/{dashboard_id}/filter_state/{KEY}") assert resp.status_code == 403
def test_delete(client, dashboard_id: int): login(client, "admin") resp = client.delete(f"api/v1/dashboard/{dashboard_id}/filter_state/{KEY}") assert resp.status_code == 200