test: test_cache_logging is not depending on other dashboard (#11213)

* Changed test_cache_logging to be idempotent and not depending on other data than tested one

* Changed cache uid to be depending on table, not datashource
This commit is contained in:
Kasia Kucharczyk 2020-10-09 18:00:41 +02:00 committed by GitHub
parent 761e6dbf52
commit d93b1afe79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -588,10 +588,10 @@ class TestCore(SupersetTestCase):
) == [{"slice_id": slc.id, "viz_error": None, "viz_status": "success"}]
def test_cache_logging(self):
slc = self.get_slice("Girls", db.session)
self.get_json_resp("/superset/warm_up_cache?slice_id={}".format(slc.id))
girls_slice = self.get_slice("Girls", db.session)
self.get_json_resp("/superset/warm_up_cache?slice_id={}".format(girls_slice.id))
ck = db.session.query(CacheKey).order_by(CacheKey.id.desc()).first()
assert ck.datasource_uid == "3__table"
assert ck.datasource_uid == f"{girls_slice.table.id}__table"
def test_shortner(self):
self.login(username="admin")