diff --git a/faker/providers/currency/ru_RU/__init__.py b/faker/providers/currency/ru_RU/__init__.py index f6843c22bd..36d796ad10 100644 --- a/faker/providers/currency/ru_RU/__init__.py +++ b/faker/providers/currency/ru_RU/__init__.py @@ -171,7 +171,7 @@ class Provider(CurrencyProvider): ("ZWD", "Доллар Зимбабве"), ) - price_formats = ["#,##", "%#,##", "%##,##", "%.###,##", "%#.###,##"] + price_formats = ["#,##", "%#,##", "%##,##", "% ###,##", "%# ###,##"] def pricetag(self) -> str: return ( diff --git a/tests/providers/test_currency.py b/tests/providers/test_currency.py index 862a508141..5161749de6 100644 --- a/tests/providers/test_currency.py +++ b/tests/providers/test_currency.py @@ -1,3 +1,5 @@ +import re + from unittest.mock import patch import pytest @@ -117,6 +119,8 @@ def setup_class(cls): cls.currencies = cls.provider.currencies cls.currency_codes, cls.currency_names = tuple(zip(*cls.currencies)) + cls.pricetag_pattern = re.compile(r"\d{1,3}(?:\s\d{3})*,\d{2}\sр\.") + def test_currency(self, faker, num_samples): for _ in range(num_samples): cur = faker.currency() @@ -131,6 +135,7 @@ def test_pricetag(self, faker, num_samples): for _ in range(num_samples): pricetag = faker.pricetag() assert isinstance(pricetag, str) + assert self.pricetag_pattern.fullmatch(pricetag) class TestCsCz: