tests: added fixture with energy usage instead of example (#11308)

* Added energy usage fixture. Updated dashboard utils and unicode fixture with new method parameters.

* Add energy fixture to tests/access_tests.py

* Add energy fixture to tests/core_tests.py

* Add energy fixture to tests/dashboard_tests.py

* Add energy fixture to tests/datasets/api_tests.py

* Add energy fixture to tests/db_engine_specs/base_engine_spec_tests.py

* Add energy fixture to tests/import_export_tests.py

* Add energy fixture to tests/model_tests.py

* Add energy fixture to tests/query_context_tests.py

* Add energy fixture to tests/security_tests.py

* Add energy fixture to tests/charts/api_tests.py

* Changed formatting of slices' parameters in energy usage fixture

* Removed loading energy udage data from test conf file

* Add energy fixture to tests/databases/api_tests.py

* Fixes after review: removed isort:skip, load_charts->load_energy_charts, removed unused import.

* Added energy fixture to tests/charts/commands_tests.py and retrieving proper Slice by name

* Fixed charts/api_tests.py to use energy_usage from fixtures

* Fixed datasets/commands_tests.py to retrieve dataset by name and use energy_usage fixture

* Changed energy usage data to generated data and fixed chart tests which was checking energy usage data
This commit is contained in:
Kasia Kucharczyk
2020-12-09 21:02:29 +01:00
committed by GitHub
parent 6270fa2026
commit 4da47f1635
16 changed files with 259 additions and 22 deletions

View File

@@ -39,6 +39,7 @@ from superset.utils.core import backend, get_example_database, get_main_database
from superset.utils.dict_import_export import export_to_dict
from tests.base_tests import SupersetTestCase
from tests.conftest import CTAS_SCHEMA_NAME
from tests.fixtures.energy_dashboard import load_energy_table_with_slice
from tests.fixtures.importexport import (
database_config,
database_metadata_config,
@@ -196,6 +197,7 @@ class TestDatasetApi(SupersetTestCase):
assert response["count"] == 0
assert response["result"] == []
@pytest.mark.usefixtures("load_energy_table_with_slice")
def test_get_dataset_item(self):
"""
Dataset API: Test get dataset item