fix: caching on viz with relative time ranges and time compare (#10061)

This commit is contained in:
Erik Ritter
2020-06-16 08:47:35 -07:00
committed by GitHub
parent 51a42a27e7
commit 7504b1cf20
2 changed files with 20 additions and 5 deletions

View File

@@ -122,7 +122,21 @@ class CoreTests(SupersetTestCase):
cache_key = viz.cache_key(qobj)
qobj["groupby"] = []
self.assertNotEqual(cache_key, viz.cache_key(qobj))
cache_key_with_groupby = viz.cache_key(qobj)
self.assertNotEqual(cache_key, cache_key_with_groupby)
self.assertNotEqual(
viz.cache_key(qobj), viz.cache_key(qobj, time_compare="12 weeks")
)
self.assertNotEqual(
viz.cache_key(qobj, time_compare="28 days"),
viz.cache_key(qobj, time_compare="12 weeks"),
)
qobj["inner_from_dttm"] = datetime.datetime(1901, 1, 1)
self.assertEquals(cache_key_with_groupby, viz.cache_key(qobj))
def test_get_superset_tables_not_allowed(self):
example_db = utils.get_example_database()