Repository: joke2k/faker
Pull request #2008 (2024-03-16 15:45:30)

Add addition address for cs_CZ
Add addition address for cs_CZ



Patch:
diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index 7ed241e9..6b59eb2d 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 24.2.0
+current_version = 24.3.0
 files = VERSION faker/__init__.py docs/conf.py
 commit = True
 tag = True
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dbf58b9f..dcf4df0f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
 ## Changelog
 
+### [v24.3.0 - 2024-03-18](https://github.com/joke2k/faker/compare/v24.2.1...v24.3.0)
+
+* Add phone number formats to nl_BE. Thanks @maximegmd.
+
+### [v24.2.1 - 2024-03-18](https://github.com/joke2k/faker/compare/v24.2.0...v24.2.1)
+
+* Return capitalized city names in `hu_HU`. Thanks @AlexLitvino.
+
 ### [v24.2.0 - 2024-03-13](https://github.com/joke2k/faker/compare/v24.1.1...v24.2.0)
 
 * Add `uk-UA` credit card provider. Thanks @lozik4.
diff --git a/VERSION b/VERSION
index 5003ba8f..e9a9b451 100644
--- a/VERSION
+++ b/VERSION
@@ -1,1 +1,1 @@
-24.2.0
+24.3.0
diff --git a/docs/conf.py b/docs/conf.py
index 38a591fc..9cd88835 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -51,9 +51,9 @@ copyright = "2014-{0}, Daniele Faraglia".format(datetime.now().year)
 # built documents.
 #
 # The short X.Y version.
-version = "24.2.0"
+version = "24.3.0"
 # The full version, including alpha/beta/rc tags.
-release = "24.2.0"
+release = "24.3.0"
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/faker/__init__.py b/faker/__init__.py
index f4a92814..ec1d3142 100644
--- a/faker/__init__.py
+++ b/faker/__init__.py
@@ -2,6 +2,6 @@ from faker.factory import Factory
 from faker.generator import Generator
 from faker.proxy import Faker
 
-VERSION = "24.2.0"
+VERSION = "24.3.0"
 
 __all__ = ("Factory", "Generator", "Faker")
diff --git a/faker/providers/address/cs_CZ/__init__.py b/faker/providers/address/cs_CZ/__init__.py
index a45ef193..5b7722c4 100644
--- a/faker/providers/address/cs_CZ/__init__.py
+++ b/faker/providers/address/cs_CZ/__init__.py
@@ -529,6 +529,8 @@ class Provider(AddressProvider):
         "Vizovická",
         "K Brusce",
         "Mírová",
+        "Písnická",
+        "Durychova",
         "Rašínská",
         "Boušova",
         "Pobřežní",
@@ -550,6 +552,14 @@ class Provider(AddressProvider):
         "Vlašimská",
         "Nad Rohatci",
         "Tylišovská",
+        "Liškova",
+        "Kunratická",
+        "Branická",
+        "Na Strži",
+        "Višňová",
+        "Sulická",
+        "Zálesí",
+        "Vídeňská",
         "Nábřeží Kapitána Jaroše",
         "Lešovská",
         "U Podjezdu",
@@ -652,6 +662,8 @@ class Provider(AddressProvider):
         "Čerpadlová",
         "Vítězná",
         "Nad Plynovodem",
+        "Novodvorská",
+        "Budějovická",
         "U Smíchovského Hřbitova",
         "Nedvědovo Náměstí",
         "Bachova",
@@ -926,6 +938,7 @@ class Provider(AddressProvider):
         "Jilmová",
         "Hostýnská",
         "Otradovická",
+        "Cihlářova",
         "Opavská",
         "Hradecká",
         "Vinohradská",
diff --git a/faker/providers/address/hu_HU/__init__.py b/faker/providers/address/hu_HU/__init__.py
index 990f6379..54c7150d 100644
--- a/faker/providers/address/hu_HU/__init__.py
+++ b/faker/providers/address/hu_HU/__init__.py
@@ -467,3 +467,13 @@ class Provider(AddressProvider):
     def building_number(self) -> str:
         numeric_part = super().random_int(1, 250)
         return str(numeric_part) + "."
+
+    # method added to fix #1996:
+    # for hu_Hu locale city_part could be first or second component of city,
+    # so city_parts tuple should contain lower-cased strings. Thus city might be lower-cased and should be capitalized
+    def city(self) -> str:
+        """
+        :example: 'Györgyháza'
+        """
+        pattern: str = self.random_element(self.city_formats)
+        return self.generator.parse(pattern).capitalize()
diff --git a/faker/providers/phone_number/nl_BE/__init__.py b/faker/providers/phone_number/nl_BE/__init__.py
index 3b62626d..a1492cdf 100644
--- a/faker/providers/phone_number/nl_BE/__init__.py
+++ b/faker/providers/phone_number/nl_BE/__init__.py
@@ -19,4 +19,6 @@ class Provider(PhoneNumberProvider):
         "+32(0)##-#######",
         "(0###)-######",
         "(0##)-#######",
+        "0#/ ### ## ##",
+        "0# ### ## ##",
     )


Test patch:
diff --git a/tests/providers/test_address.py b/tests/providers/test_address.py
index fa8ebf29..45607994 100644
--- a/tests/providers/test_address.py
+++ b/tests/providers/test_address.py
@@ -2159,6 +2159,26 @@ class TestHuHu:
             match = re.fullmatch(r"\d{0,3}.", building_number)
             assert match
 
+    def test_city(self, faker, num_samples):
+        # generating possible variations for cities for hu_Hu locale
+        real_cities = [city.lower() for city in HuHuAddressProvider.real_city_names]
+        cities_part_suffix = [
+            "".join([part, suffix])
+            for part in HuHuAddressProvider.city_parts
+            for suffix in HuHuAddressProvider.city_suffixes
+        ]
+        cities_prefix_part_suffix = [
+            "".join([pref, part_suffix])
+            for pref in HuHuAddressProvider.city_prefs
+            for part_suffix in cities_part_suffix
+        ]
+        cities = real_cities + cities_part_suffix + cities_prefix_part_suffix
+        for _ in range(num_samples):
+            city = faker.city()
+            assert isinstance(city, str)
+            assert city.lower() in cities
+            assert city[0].isupper()
+
 
 class TestIdId:
     """Test id_ID address provider methods"""