john-bodley commented on code in PR #25952:
URL: https://github.com/apache/superset/pull/25952#discussion_r1394836371


##########
tests/unit_tests/migrations/viz/dual_line_to_mixed_chart_test.py:
##########
@@ -68,30 +69,4 @@ def test_migration() -> None:
 
 
 def upgrade_downgrade(source, target) -> None:

Review Comment:
   This is legacy, but this method name is somewhat confusing, i.e., I'm not 
_entirely_ sure what it does.



##########
tests/unit_tests/migrations/viz/dual_line_to_mixed_chart_test.py:
##########
@@ -68,30 +69,4 @@ def test_migration() -> None:
 
 
 def upgrade_downgrade(source, target) -> None:
-    from superset.models.slice import Slice
-
-    dumped_form_data = json.dumps(source)
-
-    slc = Slice(
-        viz_type=MigrateDualLine.source_viz_type,
-        datasource_type="table",
-        params=dumped_form_data,
-        query_context=f'{{"form_data": {dumped_form_data}}}',
-    )
-
-    # upgrade
-    slc = MigrateDualLine.upgrade_slice(slc)
-
-    # verify form_data
-    new_form_data = json.loads(slc.params)
-    assert new_form_data == target
-    assert new_form_data["form_data_bak"] == source
-
-    # verify query_context
-    new_query_context = json.loads(slc.query_context)
-    assert new_query_context["form_data"]["viz_type"] == "mixed_timeseries"
-
-    # downgrade
-    slc = MigrateDualLine.downgrade_slice(slc)
-    assert slc.viz_type == MigrateDualLine.source_viz_type
-    assert json.loads(slc.params) == source
+    migrate_and_assert(MigrateDualLine, source, target)

Review Comment:
   Thanks for the refactor.



-- 
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]

Reply via email to