diff --git a/faker/providers/currency/fa_IR/__init__.py b/faker/providers/currency/fa_IR/__init__.py new file mode 100644 index 0000000000..747313be32 --- /dev/null +++ b/faker/providers/currency/fa_IR/__init__.py @@ -0,0 +1,8 @@ +from .. import Provider as CurrencyProvider + + +class Provider(CurrencyProvider): + price_formats = ["###,###,000","#,###,000,000", "%,###,###,###,###", "%,###,###,###,000,000"] + + def pricetag(self) -> str: + return self.numerify(self.random_element(self.price_formats)) + "\uFDFC" diff --git a/tests/providers/test_currency.py b/tests/providers/test_currency.py index 751117e7e0..862a508141 100644 --- a/tests/providers/test_currency.py +++ b/tests/providers/test_currency.py @@ -247,6 +247,23 @@ def test_pricetag(self, faker, num_samples): assert isinstance(pricetag, str) +class TestFaIr: + """Test fa_IR currency provider""" + + num_samples = 100 + + @classmethod + def setup_class(cls): + from faker.providers.currency.fa_IR import Provider as FaIrCurrencyProvider + + cls.provider = FaIrCurrencyProvider + + def test_pricetag(self, faker, num_samples): + for _ in range(num_samples): + pricetag = faker.pricetag() + assert isinstance(pricetag, str) + + class TestFrCa: """Test fr_CA currency provider"""