Repository: joke2k/faker
Pull request #1671 (2022-06-09 13:28:18)

Fix area codes for French phone numbers
What does this change
Fix a wrong area code for French phone numbers ("58 " instead of "508")

What was wrong
French phone number generation could lead to invalid phone number like "058 XXXXXX"


Patch:
diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index b8d0e8cd..d076fb11 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 13.12.1
+current_version = 13.13.0
 files = VERSION faker/__init__.py docs/conf.py
 commit = True
 tag = True
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d9534c53..977e43a5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 ## Changelog
 
+### [v13.13.0 - 2022-06-10](https://github.com/joke2k/faker/compare/v13.12.1...v13.13.0)
+
+* Add support for ISO 8601 timestamp profiles. Thanks @tplessas.
+
 ### [v13.12.1 - 2022-06-06](https://github.com/joke2k/faker/compare/v13.12.0...v13.12.1)
 
 *  Correct RUT range in `es_CL`. Thanks @nstuardod.
diff --git a/VERSION b/VERSION
index 05d5d0f4..0b704f2a 100644
--- a/VERSION
+++ b/VERSION
@@ -1,1 +1,1 @@
-13.12.1
+13.13.0
diff --git a/docs/conf.py b/docs/conf.py
index e3c51ba1..02e85c49 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -51,9 +51,9 @@ copyright = "2014, Daniele Faraglia"
 # built documents.
 #
 # The short X.Y version.
-version = "13.12.1"
+version = "13.13.0"
 # The full version, including alpha/beta/rc tags.
-release = "13.12.1"
+release = "13.13.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 81da6d63..6b5bd186 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 = "13.12.1"
+VERSION = "13.13.0"
 
 __all__ = ("Factory", "Generator", "Faker")
diff --git a/faker/providers/date_time/__init__.py b/faker/providers/date_time/__init__.py
index 19d44689..9178c11b 100644
--- a/faker/providers/date_time/__init__.py
+++ b/faker/providers/date_time/__init__.py
@@ -1877,12 +1877,17 @@ class Provider(BaseProvider):
         self,
         tzinfo: Optional[TzInfo] = None,
         end_datetime: Optional[DateParseType] = None,
+        sep: str = "T",
+        timespec: str = "auto",
     ) -> str:
         """
+        Get a timestamp in ISO 8601 format (or one of its profiles).
         :param tzinfo: timezone, instance of datetime.tzinfo subclass
+        :param sep: separator between date and time, defaults to 'T'
+        :param timespec: format specifier for the time part, defaults to 'auto' - see datetime.isoformat() documentation
         :example: '2003-10-21T16:05:52+0000'
         """
-        return self.date_time(tzinfo, end_datetime=end_datetime).isoformat()
+        return self.date_time(tzinfo, end_datetime=end_datetime).isoformat(sep, timespec)
 
     def date(self, pattern: str = "%Y-%m-%d", end_datetime: Optional[DateParseType] = None) -> str:
         """
diff --git a/faker/providers/phone_number/fr_FR/__init__.py b/faker/providers/phone_number/fr_FR/__init__.py
index decf7d35..1631b7c7 100644
--- a/faker/providers/phone_number/fr_FR/__init__.py
+++ b/faker/providers/phone_number/fr_FR/__init__.py
@@ -202,7 +202,7 @@ class Provider(PhoneNumberProvider):
         "497",
         "498",
         "499",
-        "58 ",
+        "508",
         "516",
         "517",
         "518",


Test patch:
diff --git a/tests/providers/test_date_time.py b/tests/providers/test_date_time.py
index 0ed74cbb..2472149b 100644
--- a/tests/providers/test_date_time.py
+++ b/tests/providers/test_date_time.py
@@ -179,6 +179,17 @@ class TestDateTime(unittest.TestCase):
 
         assert not self.fake.iso8601().endswith("+00:00")
         assert self.fake.iso8601(utc).endswith("+00:00")
+        assert self.fake.iso8601()[10] == "T"
+        assert len(self.fake.iso8601()) == 19
+        assert len(self.fake.iso8601(timespec="hours")) == 13
+        assert len(self.fake.iso8601(timespec="minutes")) == 16
+        assert len(self.fake.iso8601(timespec="seconds")) == 19
+        assert len(self.fake.iso8601(timespec="milliseconds")) == 23
+        assert len(self.fake.iso8601(timespec="microseconds")) == 26
+        # frequently used RFC 3339 separators
+        assert self.fake.iso8601(tzinfo=utc, sep="t")[10] == "t"
+        assert self.fake.iso8601(tzinfo=utc, sep=" ")[10] == " "
+        assert self.fake.iso8601(tzinfo=utc, sep="_")[10] == "_"
 
     def test_date_object(self):
         assert isinstance(self.fake.date_object(), date)