fix: API tests, make them possible to run independently again (#13076)

* fix: API tests, possible to run independently

* fix workflow name
This commit is contained in:
Daniel Vaz Gaspar
2021-02-11 18:19:41 +00:00
committed by GitHub
parent 0cf57756f0
commit fa4c118e2d
5 changed files with 42 additions and 16 deletions

View File

@@ -23,7 +23,6 @@ import pytest
import prison
from sqlalchemy.sql import func
import tests.test_app
from superset import db
from superset.models.core import Database
from superset.models.slice import Slice
@@ -36,8 +35,9 @@ from superset.models.reports import (
ReportRecipientType,
ReportState,
)
import tests.test_app
from tests.base_tests import SupersetTestCase
from tests.fixtures.birth_names_dashboard import load_birth_names_dashboard_with_slices
from tests.reports.utils import insert_report_schedule
from superset.utils.core import get_example_database
@@ -403,7 +403,7 @@ class TestReportSchedulesApi(SupersetTestCase):
rv = self.client.get(uri)
assert rv.status_code == 200
@pytest.mark.usefixtures("create_report_schedules")
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_create_report_schedule(self):
"""
ReportSchedule Api: Test create report schedule
@@ -508,7 +508,7 @@ class TestReportSchedulesApi(SupersetTestCase):
rv = self.client.post(uri, json=report_schedule_data)
assert rv.status_code == 400
@pytest.mark.usefixtures("create_report_schedules")
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_create_report_schedule_chart_dash_validation(self):
"""
ReportSchedule Api: Test create report schedule chart and dashboard validation
@@ -556,7 +556,7 @@ class TestReportSchedulesApi(SupersetTestCase):
data = json.loads(rv.data.decode("utf-8"))
assert data == {"message": {"database": "Database is required for alerts"}}
@pytest.mark.usefixtures("create_report_schedules")
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_create_report_schedule_relations_exist(self):
"""
ReportSchedule Api: Test create report schedule
@@ -700,7 +700,9 @@ class TestReportSchedulesApi(SupersetTestCase):
rv = self.client.put(uri, json=report_schedule_data)
assert rv.status_code == 404
@pytest.mark.usefixtures("create_report_schedules")
@pytest.mark.usefixtures(
"load_birth_names_dashboard_with_slices", "create_report_schedules"
)
def test_update_report_schedule_chart_dash_validation(self):
"""
ReportSchedule Api: Test update report schedule chart and dashboard validation
@@ -727,7 +729,9 @@ class TestReportSchedulesApi(SupersetTestCase):
data = json.loads(rv.data.decode("utf-8"))
assert data == {"message": {"chart": "Choose a chart or dashboard not both"}}
@pytest.mark.usefixtures("create_report_schedules")
@pytest.mark.usefixtures(
"load_birth_names_dashboard_with_slices", "create_report_schedules"
)
def test_update_report_schedule_relations_exist(self):
"""
ReportSchedule Api: Test update report schedule relations exist