mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix: error while parsing invalid json form_data (#12586)
* Fix error while parsing invalid json form_data * Refine error returned
This commit is contained in:
@@ -925,7 +925,7 @@ class TestUtils(SupersetTestCase):
|
||||
|
||||
self.assertEqual(
|
||||
form_data,
|
||||
{"time_range_endpoints": get_time_range_endpoints(form_data={}),},
|
||||
{"time_range_endpoints": get_time_range_endpoints(form_data={})},
|
||||
)
|
||||
|
||||
self.assertEqual(slc, None)
|
||||
@@ -994,6 +994,20 @@ class TestUtils(SupersetTestCase):
|
||||
|
||||
self.assertEqual(slc, None)
|
||||
|
||||
def test_get_form_data_corrupted_json(self) -> None:
|
||||
with app.test_request_context(
|
||||
data={"form_data": "{x: '2324'}"},
|
||||
query_string={"form_data": '{"baz": "bar"'},
|
||||
):
|
||||
form_data, slc = get_form_data()
|
||||
|
||||
self.assertEqual(
|
||||
form_data,
|
||||
{"time_range_endpoints": get_time_range_endpoints(form_data={})},
|
||||
)
|
||||
|
||||
self.assertEqual(slc, None)
|
||||
|
||||
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
|
||||
def test_log_this(self) -> None:
|
||||
# TODO: Add additional scenarios.
|
||||
|
||||
Reference in New Issue
Block a user