From df4f19a389006648bc7249cc734d1b889ce0b84f Mon Sep 17 00:00:00 2001 From: Alex Gibson Date: Wed, 2 Aug 2023 09:27:33 +0100 Subject: [PATCH] Update euro currency formatting for English locales (Issue #13476) --- bedrock/products/tests/test_helper_misc.py | 16 ++++++++++++++-- bedrock/settings/base.py | 6 +++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/bedrock/products/tests/test_helper_misc.py b/bedrock/products/tests/test_helper_misc.py index 0ee71181ce7..ba348658779 100644 --- a/bedrock/products/tests/test_helper_misc.py +++ b/bedrock/products/tests/test_helper_misc.py @@ -61,8 +61,8 @@ "monthly": {"id": "price_1N7PQIJNcmPzuWtR2BQdQbtL", "price": "9,99 €", "total": None, "saving": None}, }, "en": { # English - "12-month": {"id": "price_1JcdvBJNcmPzuWtROLbEH9d2", "price": "4,99 €", "total": "59,88 €", "saving": 50}, - "monthly": {"id": "price_1JcdsSJNcmPzuWtRGF9Y5TMJ", "price": "9,99 €", "total": None, "saving": None}, + "12-month": {"id": "price_1JcdvBJNcmPzuWtROLbEH9d2", "price": "4.99 €", "total": "59.88 €", "saving": 50}, + "monthly": {"id": "price_1JcdsSJNcmPzuWtRGF9Y5TMJ", "price": "9.99 €", "total": None, "saving": None}, }, "es": { # Spanish "12-month": {"id": "price_1J5JCdJNcmPzuWtRrvQMFLlP", "price": "4,99 €", "total": "59,88 €", "saving": 50}, @@ -1015,6 +1015,12 @@ def test_vpn_monthly_price_euro(self): expected = '9,99 €/month' self.assertEqual(markup, expected) + def test_vpn_monthly_price_euro_en_us(self): + """Should return expected markup""" + markup = self._render(plan="monthly", country_code="FI", lang="en-US") + expected = '9.99 €/month' + self.assertEqual(markup, expected) + def test_vpn_monthly_price_chf(self): """Should return expected markup""" markup = self._render(plan="monthly", country_code="CH", lang="de") @@ -1039,6 +1045,12 @@ def test_vpn_12_month_price_euro(self): expected = '4,99 €/month' self.assertEqual(markup, expected) + def test_vpn_12_month_price_euro_en_us(self): + """Should return expected markup""" + markup = self._render(plan="12-month", country_code="FI", lang="en-US") + expected = '4.99 €/month' + self.assertEqual(markup, expected) + def test_vpn_12_month_price_chf(self): """Should return expected markup""" markup = self._render(plan="12-month", country_code="CH", lang="de") diff --git a/bedrock/settings/base.py b/bedrock/settings/base.py index 325fc05db92..eefb4697f9e 100644 --- a/bedrock/settings/base.py +++ b/bedrock/settings/base.py @@ -1328,14 +1328,14 @@ def before_send(event, hint): "en": { # English "12-month": { "id": "price_1JcuArKb9q6OnNsLXAnkCSUE" if DEV else "price_1JcdvBJNcmPzuWtROLbEH9d2", - "price": "4,99 €", - "total": "59,88 €", + "price": "4.99 €", + "total": "59.88 €", "saving": 50, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "60.00", "price": "59.88", "period": "yearly"}, }, "monthly": { "id": "price_1Jcu7uKb9q6OnNsLG4JAAXuw" if DEV else "price_1JcdsSJNcmPzuWtRGF9Y5TMJ", - "price": "9,99 €", + "price": "9.99 €", "total": None, "saving": None, "analytics": {"brand": "vpn", "plan": "vpn", "currency": "EUR", "discount": "0", "price": "9.99", "period": "monthly"},