rusackas commented on code in PR #42404: URL: https://github.com/apache/superset/pull/42404#discussion_r3858700950
########## tests/unit_tests/migrations/test_add_theme_editors.py: ########## @@ -0,0 +1,166 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""Tests for migration ``f7e8d9c0b1a2_add_theme_editors_table``. + +Runs the migration's ``upgrade()`` and ``downgrade()`` against an in-memory +SQLite engine with a real Alembic ``Operations`` context. The referenced +``subjects`` and ``themes`` tables are seeded so the junction table's foreign +keys can be created (via the shared SQLite-compatible helpers). +""" + +from __future__ import annotations + +from importlib import import_module + +import pytest +from alembic.migration import MigrationContext +from alembic.operations import Operations +from sqlalchemy import ( + Boolean, + Column, + create_engine, + inspect, + Integer, + MetaData, + String, + Table, + text, +) +from sqlalchemy.engine import Engine + +migration = import_module( + "superset.migrations.versions.2026-07-24_00-00_f7e8d9c0b1a2_add_theme_editors_table" +) + +THEME_EDITORS = migration.THEME_EDITORS # "theme_editors" + + +def test_revision_chain() -> None: + """The migration must sit directly on top of the current single head.""" + assert migration.revision == "f7e8d9c0b1a2" + assert migration.down_revision == "1072de5ed955" Review Comment: ```suggestion assert migration.down_revision == "39097d124752" ``` -- 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]
