You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jl...@apache.org on 2025/03/26 22:28:24 UTC
(superset) 02/02: fix(log): Update recent_activity by event name (#32681)
This is an automated email from the ASF dual-hosted git repository.
jli pushed a commit to branch 4.1
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 10fb45849b41877e7ef396912fab80dc7ef7e56b
Author: JUST.in DO IT <ju...@airbnb.com>
AuthorDate: Mon Mar 17 09:18:47 2025 -0700
fix(log): Update recent_activity by event name (#32681)
(cherry picked from commit 449f51aed56b3b1f91b04476b20033efc3610c8b)
---
tests/integration_tests/log_api_tests.py | 97 +++++++++++++++-----------------
1 file changed, 44 insertions(+), 53 deletions(-)
diff --git a/tests/integration_tests/log_api_tests.py b/tests/integration_tests/log_api_tests.py
index 644f4cddd5..0666f4e156 100644
--- a/tests/integration_tests/log_api_tests.py
+++ b/tests/integration_tests/log_api_tests.py
@@ -194,21 +194,18 @@ class TestLogApi(SupersetTestCase):
db.session.delete(dash)
db.session.commit()
- self.assertEqual(
- response,
- {
- "result": [
- {
- "action": "log",
- "item_type": "dashboard",
- "item_url": "/superset/dashboard/dash_slug/",
- "item_title": "dash_title",
- "time": ANY,
- "time_delta_humanized": ANY,
- }
- ]
- },
- )
+ assert response == {
+ "result": [
+ {
+ "action": "log",
+ "item_type": "dashboard",
+ "item_url": "/superset/dashboard/dash_slug/",
+ "item_title": "dash_title",
+ "time": ANY,
+ "time_delta_humanized": ANY,
+ }
+ ]
+ }
def test_get_recent_activity_actions_filter(self):
"""
@@ -316,29 +313,26 @@ class TestLogApi(SupersetTestCase):
self.assertEqual(rv.status_code, 200)
response = json.loads(rv.data.decode("utf-8"))
- self.assertEqual(
- response,
- {
- "result": [
- {
- "action": "log",
- "item_type": "dashboard",
- "item_url": "/superset/dashboard/dash3_slug/",
- "item_title": "dash3_title",
- "time": ANY,
- "time_delta_humanized": ANY,
- },
- {
- "action": "log",
- "item_type": "dashboard",
- "item_url": "/superset/dashboard/dash2_slug/",
- "item_title": "dash2_title",
- "time": ANY,
- "time_delta_humanized": ANY,
- },
- ]
- },
- )
+ assert response == {
+ "result": [
+ {
+ "action": "log",
+ "item_type": "dashboard",
+ "item_url": "/superset/dashboard/dash3_slug/",
+ "item_title": "dash3_title",
+ "time": ANY,
+ "time_delta_humanized": ANY,
+ },
+ {
+ "action": "log",
+ "item_type": "dashboard",
+ "item_url": "/superset/dashboard/dash2_slug/",
+ "item_title": "dash2_title",
+ "time": ANY,
+ "time_delta_humanized": ANY,
+ },
+ ]
+ }
arguments = {"page": 1, "page_size": 2}
uri = f"api/v1/log/recent_activity/?q={prison.dumps(arguments)}"
@@ -354,18 +348,15 @@ class TestLogApi(SupersetTestCase):
self.assertEqual(rv.status_code, 200)
response = json.loads(rv.data.decode("utf-8"))
- self.assertEqual(
- response,
- {
- "result": [
- {
- "action": "log",
- "item_type": "dashboard",
- "item_url": "/superset/dashboard/dash_slug/",
- "item_title": "dash_title",
- "time": ANY,
- "time_delta_humanized": ANY,
- }
- ]
- },
- )
+ assert response == {
+ "result": [
+ {
+ "action": "log",
+ "item_type": "dashboard",
+ "item_url": "/superset/dashboard/dash_slug/",
+ "item_title": "dash_title",
+ "time": ANY,
+ "time_delta_humanized": ANY,
+ }
+ ]
+ }