Skip to content

Commit

Permalink
Add ut
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje committed Mar 22, 2024
1 parent af29379 commit 4628fb1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/integration_tests/core_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,21 @@ def test_has_table_by_name(self):
is True
)

@mock.patch("superset.views.core.request")
@mock.patch(
"superset.commands.dashboard.permalink.get.GetDashboardPermalinkCommand.run"
)
def test_dashboard_permalink(self, get_dashboard_permalink_mock, request_mock):
request_mock.query_string = b"standalone=3"
get_dashboard_permalink_mock.return_value = {"dashboardId": 1}
self.login()
resp = self.client.get("superset/dashboard/p/123/")

expected_url = "/superset/dashboard/1?permalink_key=123&standalone=3"

self.assertEqual(resp.headers["Location"], expected_url)
assert resp.status_code == 302


if __name__ == "__main__":
unittest.main()

0 comments on commit 4628fb1

Please sign in to comment.