mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
test: removed unicode_test example from unit tests (#11131)
* Removed depemdency to unicode example in tests config. * Added common methods for creating dashboards for tests. * Added fixtures to all tests which were using unicode example. * Added cleanup for unicode_test table * Removed unnecessary fixture parts of unicode dashboard tests * Parametrized creating slice for tests * Moved fixtures for unicode test to separate file and refactored to several methods. Added param types and return types. * Cleandup after fix * Changed variable names to more readable * Added cleanup for dashboards and slices * Applied unicode fixture to charts api tests * Update schema variable to dtype in dashboard utils Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com> * Changed variable schema to dtype in dashboards. Replaced accessing first element with one_or_none Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
This commit is contained in:
@@ -28,6 +28,7 @@ from sqlalchemy import and_
|
||||
from sqlalchemy.sql import func
|
||||
|
||||
from superset.utils.core import get_example_database
|
||||
from tests.fixtures.unicode_dashboard import load_unicode_dashboard_with_slice
|
||||
from tests.test_app import app
|
||||
from superset.connectors.connector_registry import ConnectorRegistry
|
||||
from superset.extensions import db, security_manager
|
||||
@@ -567,6 +568,7 @@ class TestChartApi(SupersetTestCase, ApiOwnersTestCaseMixin):
|
||||
rv = self.client.get(uri)
|
||||
self.assertEqual(rv.status_code, 404)
|
||||
|
||||
@pytest.mark.usefixtures("load_unicode_dashboard_with_slice")
|
||||
def test_get_charts(self):
|
||||
"""
|
||||
Chart API: Test get charts
|
||||
@@ -733,6 +735,7 @@ class TestChartApi(SupersetTestCase, ApiOwnersTestCaseMixin):
|
||||
assert rv.status_code == 200
|
||||
assert len(expected_models) == data["count"]
|
||||
|
||||
@pytest.mark.usefixtures("load_unicode_dashboard_with_slice")
|
||||
def test_get_charts_page(self):
|
||||
"""
|
||||
Chart API: Test get charts filter
|
||||
|
||||
Reference in New Issue
Block a user