Skip to content

Commit

Permalink
Update euro currency formatting for English locales (Issue #13476)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgibson committed Aug 2, 2023
1 parent 5a8d92a commit df4f19a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
16 changes: 14 additions & 2 deletions bedrock/products/tests/test_helper_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -1015,6 +1015,12 @@ def test_vpn_monthly_price_euro(self):
expected = '<span class="vpn-monthly-price-display">9,99 €<span>/month</span></span>'
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 = '<span class="vpn-monthly-price-display">9.99 €<span>/month</span></span>'
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")
Expand All @@ -1039,6 +1045,12 @@ def test_vpn_12_month_price_euro(self):
expected = '<span class="vpn-monthly-price-display">4,99 €<span>/month</span></span>'
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 = '<span class="vpn-monthly-price-display">4.99 €<span>/month</span></span>'
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")
Expand Down
6 changes: 3 additions & 3 deletions bedrock/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down

0 comments on commit df4f19a

Please sign in to comment.