feat(explore): time picker enhancement (#11418)

This commit is contained in:
Yongjie Zhao
2020-12-18 10:27:21 +08:00
committed by GitHub
parent 92fdf54aa3
commit b592cc7e73
14 changed files with 1521 additions and 91 deletions

View File

@@ -982,6 +982,18 @@ class TestChartApi(SupersetTestCase, ApiOwnersTestCaseMixin):
if res["id"] in users_favorite_ids:
assert res["value"]
def test_get_time_range(self):
"""
Chart API: Test get actually time range from human readable string
"""
self.login(username="admin")
humanize_time_range = "100 years ago : now"
uri = f"api/v1/time_range/?q={prison.dumps(humanize_time_range)}"
rv = self.client.get(uri)
data = json.loads(rv.data.decode("utf-8"))
self.assertEqual(rv.status_code, 200)
self.assertEqual(len(data["result"]), 3)
@pytest.mark.usefixtures(
"load_unicode_dashboard_with_slice", "load_energy_table_with_slice"
)