fix: telegram stars payment in web app

This commit is contained in:
3252a8
2026-05-03 18:10:20 +03:00
parent 50857d5283
commit ca8df10eab
4 changed files with 65 additions and 13 deletions
+19
View File
@@ -27,6 +27,25 @@ class WebAppAssetTests(unittest.IsolatedAsyncioTestCase):
self.assertEqual(plans[0]["price"], 199.0)
self.assertEqual(plans[1]["stars_price"], 2500)
def test_serialize_plans_includes_stars_only_subscription_options(self):
settings = Settings(
_env_file=None,
BOT_TOKEN="token",
POSTGRES_USER="app_user",
POSTGRES_PASSWORD="app_password",
YOOKASSA_ENABLED=False,
CRYPTOPAY_ENABLED=False,
RUB_PRICE_1_MONTH=None,
STARS_PRICE_1_MONTH=250,
)
plans = subscription_webapp._serialize_plans(settings, "en")
self.assertEqual(len(plans), 1)
self.assertEqual(plans[0]["months"], 1)
self.assertEqual(plans[0]["price"], 0.0)
self.assertEqual(plans[0]["stars_price"], 250)
def test_resolve_webapp_js_asset_name_prefers_latest_minified_build(self):
with tempfile.TemporaryDirectory() as tmpdir:
asset_dir = Path(tmpdir)