feat: add Remnashop migration import

Add the Remnashop legacy importer, compatibility tables, admin toggles, referral and promo lookup compatibility, and tests for the migration flow.
This commit is contained in:
3252a8
2026-06-02 00:13:54 +03:00
parent 56796d9f22
commit 5e47a1496b
18 changed files with 1731 additions and 63 deletions
@@ -44,6 +44,13 @@ BACKUP_SETTINGS = (
"BACKUP_COMPOSE_ENABLED",
)
REMNASHOP_MIGRATION_SETTINGS = (
"MIGRATION_REMNASHOP_REFERRAL_CODE_COMPAT_ENABLED",
"MIGRATION_REMNASHOP_PROMO_CODE_COMPAT_ENABLED",
"MIGRATION_REMNASHOP_IMPORTED_AT",
"MIGRATION_REMNASHOP_NOTES",
)
ADMIN_TARIFF_SETTINGS_PAGE_KEYS = {
"admin_tariffs_trial_title",
"admin_tariffs_trial_subtitle",
@@ -204,6 +211,27 @@ def test_backup_settings_i18n_keys_exist():
assert field["i18n_description_key"] in messages
def test_remnashop_migration_settings_i18n_keys_exist():
manifest = _manifest_by_key()
for setting_key in REMNASHOP_MIGRATION_SETTINGS:
field = manifest[setting_key]
assert field["section"] == "migrations"
assert field["section_order"] == 13
assert field["subsection"] == "Remnashop"
assert field["i18n_subsection_key"] == "admin_settings_subsection_remnashop"
for language in ("ru", "en"):
messages = _locale(language)
assert "admin_settings_section_migrations" in messages
assert "admin_settings_subsection_remnashop" in messages
for setting_key in REMNASHOP_MIGRATION_SETTINGS:
field = manifest[setting_key]
assert field["i18n_label_key"] in messages
assert field["i18n_description_key"] in messages
def test_backup_required_numeric_settings_reject_empty_values():
with pytest.raises(ValueError):
coerce_value(get_field_by_key("BACKUP_INTERVAL_SECONDS"), "")