villebro commented on code in PR #22328:
URL: https://github.com/apache/superset/pull/22328#discussion_r1043024531
##########
tests/integration_tests/thumbnails_tests.py:
##########
@@ -121,50 +136,82 @@ def test_screenshot_selenium_animation_wait(
class TestThumbnails(SupersetTestCase):
mock_image = b"bytes mock image"
+ digest_return_value = "foo_bar"
+ digest_hash = "5c7d96a3dd7a87850a2ef34087565a6e"
+
+ def _get_id_and_thumbnail_url(self, url: str) -> Tuple[int, str]:
+ rv = self.client.get(url)
+ resp = json.loads(rv.data.decode("utf-8"))
+ obj = resp["result"][0]
+ return obj["id"], obj["thumbnail_url"]
+ @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
@with_feature_flags(THUMBNAILS=False)
def test_dashboard_thumbnail_disabled(self):
"""
Thumbnails: Dashboard thumbnail disabled
"""
- dashboard = db.session.query(Dashboard).all()[0]
self.login(username="admin")
- uri = f"api/v1/dashboard/{dashboard.id}/thumbnail/{dashboard.digest}/"
- rv = self.client.get(uri)
+ _, thumbnail_url = self._get_id_and_thumbnail_url(DASHBOARD_URL)
+ rv = self.client.get(thumbnail_url)
Review Comment:
Since the digest may now be affected by who is logged in, all tests are
updated to fetch the thumbnail URL via the API after login.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]