internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: joke2k/faker

Issue:
Invalid gender spec in pl_PL
```
In [9]: fake.name()
Out[9]: 'pani Mateusz Kiciak'
```

"pani" is female but "Mateusz" is male surname.


Discussion:
we need to split the prefixes in the `pl_PL` person provider by sex, and adjust the `formats` accordingly, so that we have `{{prefix_male}} {{first_name_male}} {{last_name_male}}` and `{{prefix_female}} {{first_name_female}} {{last_name_female}}`

refs:
* https://github.com/joke2k/faker/blob/master/faker/providers/person/pl_PL/__init__.py#L522
* https://github.com/joke2k/faker/blob/master/faker/providers/person/pl_PL/__init__.py#L7 

@zgoda would you be willing to submit a PR?
Yes, wait a sec.

Resolving patch:
diff --git a/faker/providers/person/pl_PL/__init__.py b/faker/providers/person/pl_PL/__init__.py
--- a/faker/providers/person/pl_PL/__init__.py
+++ b/faker/providers/person/pl_PL/__init__.py
@@ -10,9 +10,9 @@ class Provider(PersonProvider):
         '{{first_name}} {{last_name}}',
         '{{first_name}} {{last_name}}',
         '{{first_name}} {{last_name}}',
-        '{{prefix}} {{first_name}} {{last_name}}',
+        '{{prefix_female}} {{first_name_female}} {{last_name_female}}',
         '{{first_name}} {{last_name}}',
-        '{{prefix}} {{first_name}} {{last_name}}'
+        '{{prefix_male}} {{first_name_male}} {{last_name_male}}'
     )
 
     first_names_male = (
@@ -519,7 +519,8 @@ class Provider(PersonProvider):
         'Bukowski', 'Leśniak',
     )
 
-    prefixes = ('pan', 'pani')
+    prefixes_male = ('pan',)
+    prefixes_female = ('pani',)
 
     first_names = first_names_male + first_names_female
 


Test patch:
Repository: joke2k/faker

Issue:
Not possible to seed .binary()
It is not possible to seed the method ``binary`` (see also issue #484)

```
>>> from faker import Faker
>>> f1 = Faker()
>>> f1.seed(4321)
>>> print(f1.binary()[0:100])
b'm\x17 ;\xca\x88\xb6\xb1\x8c/6Qmo\x02\xfa\xc3g\xf9R\xc5\xc6\x84\n\xac\xa3\x99\xb9Xs\xc3D\xa5g\xbb\xe5YU)\x95\tt\x0fsy\xe3\xaa\xfc\xaa\xb7\xb9\xfd\xac\x88\x13\xe2\xb1!\xbc\xea\x00\xd3]"\x9c;\xf2\xecx\xee\xe1\x06\xa6_\x9by\x97\xc3\xd7\xf6\x87&\x8fM\x90{\x18\xb0/\xdf\xcf$*\xde\x13\xc1\x96&\x12\xc2'
>>> f2 = Faker()
>>> f2.seed(4321)
>>> print(f2.binary()[0:100])
b"\xc1Xf\x81\xba\xe8P\xcb\xb2\xfd\x8e\x8bz7'\xe0\x7f\xef\xdej\xf5\xb8\xf1\xe4\x97v\x7f\x9aM\xfb\xee\xabT\x17\x9c\xb7\xa6\x8f\xd1\x8c\x07l0\xc5&*\xd8\xf2B\xbf\xbe\xe8\xca\xbe\xe8\xdf\xec4\xd2\xc1\xff\xecI\xc9\xdc\xae\x92~|\xa1\x0ch\x08\\G\xd7\xd8\xf0I\xc0\xcaLR\xaa\xd6{%\xfa\x14\xd9C\x9f\x1fK\x14\xc0s?O)"
```


Discussion:

Resolving patch:
diff --git a/faker/providers/misc/__init__.py b/faker/providers/misc/__init__.py
--- a/faker/providers/misc/__init__.py
+++ b/faker/providers/misc/__init__.py
@@ -5,6 +5,7 @@
 import string
 import uuid
 import os
+import sys
 
 from faker.generator import random
 from faker.providers.date_time import Provider as DatetimeProvider
@@ -91,7 +92,8 @@ def binary(cls, length=(1 * 1024 * 1024)):
 
         Default blob size is 1 Mb.
         """
-        return os.urandom(length)
+        blob = [random.randrange(256) for o in range(length)]
+        return bytes(blob) if sys.version_info[0] >= 3 else bytearray(blob)
 
     @classmethod
     def md5(cls, raw_output=False):


Test patch:
Repository: joke2k/faker

Issue:
Uk mobile number
It seems like the uk mobile number is not in the right format 
it's completely not valid
some examples of them: 
+44(0)9128 405119
(01414) 35336
01231052134
Uk mobile number
It seems like the uk mobile number is not in the right format 
it's completely not valid
some examples of them: 
+44(0)9128 405119
(01414) 35336
01231052134


Discussion:
Hi @Ehmed-kino , thank you for reporting this.

Could you submit a PR with the correct formats?
Hi @Ehmed-kino , thank you for reporting this.

Could you submit a PR with the correct formats?

Resolving patch:
diff --git a/faker/providers/phone_number/en_GB/__init__.py b/faker/providers/phone_number/en_GB/__init__.py
--- a/faker/providers/phone_number/en_GB/__init__.py
+++ b/faker/providers/phone_number/en_GB/__init__.py
@@ -3,6 +3,15 @@
 
 
 class Provider(PhoneNumberProvider):
+    # Source: https://en.wikipedia.org/wiki/Telephone_numbers_in_the_United_Kingdom
+
+    cellphone_formats = (
+        '+44 7### ######',
+        '+44 7#########',
+        '07### ######',
+        '07#########',
+    )
+
     formats = (
         '+44(0)##########',
         '+44(0)#### ######',
@@ -15,3 +24,7 @@ class Provider(PhoneNumberProvider):
         '(0####) ######',
         '(0####) #####',
     )
+
+    def cellphone_number(self):
+        pattern = self.random_element(self.cellphone_formats)
+        return self.numerify(self.generator.parse(pattern))


Test patch:
Repository: joke2k/faker

Issue:
Unidecode dependency GPL license
In commit adc1b1b a dependency on the Unidecode python package was introduced.

Unidecode is released under the GPL license while Faker is using MIT. I'm concerned that this might not be permitted by the GPL license and that users of the Faker library might not realise they are introducing GPL code into their dependencies. It could be argued that any code using the Faker library now has to be licensed under the GPL too.

See here for some opinions on using GPL libraries:

https://opensource.stackexchange.com/questions/1640/if-im-using-a-gpl-3-library-in-my-project-can-i-license-my-project-under-mit-l
https://softwareengineering.stackexchange.com/questions/87446/using-a-gplv3-python-module-will-my-entire-project-have-to-be-gplv3-licensed
https://opensource.stackexchange.com/questions/2139/can-i-license-python-project-under-3-clause-bsd-while-it-has-gpl-based-dependenc
https://opensource.stackexchange.com/questions/6062/using-gpl-library-with-mit-licensed-code

I'm not an expert in this area at all, just a concerned user!


Discussion:

Resolving patch:
diff --git a/faker/providers/internet/__init__.py b/faker/providers/internet/__init__.py
--- a/faker/providers/internet/__init__.py
+++ b/faker/providers/internet/__init__.py
@@ -1,7 +1,7 @@
 # coding=utf-8
 from __future__ import unicode_literals
 
-import unidecode
+from text_unidecode import unidecode
 
 from .. import BaseProvider
 
@@ -71,7 +71,7 @@ def _to_ascii(self, string):
         for search, replace in self.replacements:
             string = string.replace(search, replace)
 
-        string = unidecode.unidecode(string)
+        string = unidecode(string)
         return string
 
     @lowercase
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -62,7 +62,7 @@
     install_requires=[
         "python-dateutil>=2.4",
         "six",
-        "unidecode",
+        "text-unidecode",
     ],
     test_requires=[
         "email_validator>=1.0.0,<1.1.0",


Test patch:
Repository: joke2k/faker

Issue:
MacOS 10.13 OSError: [Errno 24] Too many open files
```shell
    return [i for i in os.listdir(path) if os.path.isdir(os.path.join(path, i)) and not i.startswith('_')]
OSError: [Errno 24] Too many open files: '/Users/abcdefg/.pyenv/versions/3.6.3/envs/weixin3/lib/python3.6/site-packages/faker/providers/address'
```




Discussion:
Thank you for the report @Chaaang.

Could you describe how to reproduce the error?
May it's because of using Celery on evenlet mode. Each of my task need to generate a fake User-Agent, and the concurrency is over 200.

  

Resolving patch:
diff --git a/faker/utils/loading.py b/faker/utils/loading.py
--- a/faker/utils/loading.py
+++ b/faker/utils/loading.py
@@ -6,9 +6,7 @@
 def list_module(module):
     path = os.path.dirname(module.__file__)
     modules = [name for finder, name, is_pkg in pkgutil.iter_modules([path]) if is_pkg]
-    if len(modules) > 0:
-        return modules
-    return [i for i in os.listdir(path) if os.path.isdir(os.path.join(path, i)) and not i.startswith('_')]
+    return modules
 
 
 def find_available_locales(providers):


Test patch:
Repository: joke2k/faker

Issue:
Update user_agent chrome version
Right now provider **user_agent** can return chrome version between 13-15 which is too small (for example latest stable version is 63). I want to create PR to fix this.


Discussion:
Thanks @lcd1232 , please go ahead and submit your PR :)

Resolving patch:
diff --git a/faker/providers/user_agent/__init__.py b/faker/providers/user_agent/__init__.py
--- a/faker/providers/user_agent/__init__.py
+++ b/faker/providers/user_agent/__init__.py
@@ -33,7 +33,8 @@ def user_agent(self):
         name = self.random_element(self.user_agents)
         return getattr(self, name)()
 
-    def chrome(self):
+    def chrome(self, version_from=13, version_to=63,
+               build_from=800, build_to=899):
         saf = str(self.generator.random.randint(531, 536)) + \
             str(self.generator.random.randint(0, 2))
         tmplt = '({0}) AppleWebKit/{1} (KHTML, like Gecko)' \
@@ -41,18 +42,18 @@ def chrome(self):
         platforms = (
             tmplt.format(self.linux_platform_token(),
                          saf,
-                         self.generator.random.randint(13, 15),
-                         self.generator.random.randint(800, 899),
+                         self.generator.random.randint(version_from, version_to),
+                         self.generator.random.randint(build_from, build_to),
                          saf),
             tmplt.format(self.windows_platform_token(),
                          saf,
-                         self.generator.random.randint(13, 15),
-                         self.generator.random.randint(800, 899),
+                         self.generator.random.randint(version_from, version_to),
+                         self.generator.random.randint(build_from, build_to),
                          saf),
             tmplt.format(self.mac_platform_token(),
                          saf,
-                         self.generator.random.randint(13, 15),
-                         self.generator.random.randint(800, 899),
+                         self.generator.random.randint(version_from, version_to),
+                         self.generator.random.randint(build_from, build_to),
                          saf),
         )
 
@@ -167,6 +168,6 @@ def linux_platform_token(self):
     def mac_platform_token(self):
         return 'Macintosh; {0} Mac OS X 10_{1}_{2}'.format(
             self.random_element(self.mac_processors),
-            self.generator.random.randint(5, 8),
+            self.generator.random.randint(5, 12),
             self.generator.random.randint(0, 9),
         )


Test patch:
Repository: joke2k/faker

Issue:
NameError: name 'args' is not defined
I'm getting an error using the *args method.

```
fake.email(*args, **kwargs)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'args' is not defined

```
Also can I change the **kwargs with @gmail to get random@gmail.com?




Discussion:
@BLCKPSTV just try to call function without arguments: `fake.email()`
@BLCKPSTV You don't call it with that in there. Those are there to pass  in arguments. *args would be something like fake.email(1, 2, 'somestring') and kw = keyword, so kwargs would be something like fake.email(domain='gmail.com').

In this case email doesn't have anything like that: https://github.com/joke2k/faker/blob/891e000f06fbc2f13b16331a5577a8d9952281c6/faker/providers/internet/__init__.py#L78

That feature would need to be implemented if you wanted a specific domain. Otherwise, just do what lcd1232 said call it without passing anything in.

Resolving patch:
diff --git a/faker/providers/internet/__init__.py b/faker/providers/internet/__init__.py
--- a/faker/providers/internet/__init__.py
+++ b/faker/providers/internet/__init__.py
@@ -75,9 +75,13 @@ def _to_ascii(self, string):
         return string
 
     @lowercase
-    def email(self):
-        pattern = self.random_element(self.email_formats)
-        return "".join(self.generator.parse(pattern).split(" "))
+    def email(self, domain=None):
+        if domain:
+            email = '{0}@{1}'.format(self.user_name(), domain)
+        else:
+            pattern = self.random_element(self.email_formats)
+            email = "".join(self.generator.parse(pattern).split(" "))
+        return email
 
     @lowercase
     def safe_email(self):


Test patch:
diff --git a/tests/providers/test_internet.py b/tests/providers/test_internet.py
--- a/tests/providers/test_internet.py
+++ b/tests/providers/test_internet.py
@@ -14,6 +14,17 @@
 from tests import string_types
 
 
+class TestInternetProvider(unittest.TestCase):
+    """ Tests internet """
+
+    def setUp(self):
+        self.factory = Faker()
+
+    def test_email(self):
+        email = self.factory.email(domain='example.com')
+        self.assertEqual(email.split('@')[1], 'example.com')
+
+
 class TestJaJP(unittest.TestCase):
     """ Tests internet in the ja_JP locale """
Repository: joke2k/faker

Issue:
`date_time_ad` nondeterministically errors
Occasionally, `date_time_ad` raises `OverflowError: date value out of range`.

### Steps to reproduce

1. Substitute the random offset generation in `date_time_ad` (at the time of writing, this is `ts = self.generator.random.randint(-62135600400, end_datetime)`) for the specific value `ts = -62135596801`.
2. Call `date_time_ad()`

### Expected behavior

`date_time_ad` returns a value of type `datetime` (a naive datetime).

### Actual behavior

`date_time_ad` raises `OverflowError: date value out of range`

I have reproduced this both on a Debian Jessie machine running Python 3.5.3 and on a macOS High Sierra 10.13.2 machine running Python 3.6.4.


The error appears to occur whenever the random `ts` generation generates a value strictly less than -62135596800.

Suggested fix would be to substitute the current lower bound of `-62135600400` for a new lower bound of `-62135596800`.


Discussion:
Thanks for the report @prophile 

Your fix sounds reasonable to me. Could you submit a PR?

Resolving patch:
diff --git a/faker/providers/date_time/__init__.py b/faker/providers/date_time/__init__.py
--- a/faker/providers/date_time/__init__.py
+++ b/faker/providers/date_time/__init__.py
@@ -1209,7 +1209,7 @@ def date_time_ad(self, tzinfo=None, end_datetime=None):
         :return datetime
         """
         end_datetime = self._parse_end_datetime(end_datetime)
-        ts = self.generator.random.randint(-62135600400, end_datetime)
+        ts = self.generator.random.randint(-62135596800, end_datetime)
         # NOTE: using datetime.fromtimestamp(ts) directly will raise
         #       a "ValueError: timestamp out of range for platform time_t"
         #       on some platforms due to system C functions;


Test patch:
Repository: joke2k/faker

Issue:
AttributeError: module 'faker.providers' has no attribute '__file__'
I converted my python code to .exe using cx_Freeze. While opening my .exe file I am getting this error.

Traceback (most recent call last):
  File "C:\Program Files\Python36\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 14, in run
    module.run()
  File "C:\Program Files\Python36\lib\site-packages\cx_Freeze\initscripts\Console.py", line 26, in run
    exec(code, m.__dict__)
  File "DataGenerator.py", line 7, in <module>
  File "C:\Program Files\Python36\lib\site-packages\faker\__init__.py", line 4, in <module>
    from faker.factory import Factory
  File "C:\Program Files\Python36\lib\site-packages\faker\factory.py", line 10, in <module>
    from faker.config import DEFAULT_LOCALE, PROVIDERS, AVAILABLE_LOCALES
  File "C:\Program Files\Python36\lib\site-packages\faker\config.py", line 11, in <module>
    PROVIDERS = find_available_providers([import_module(path) for path in META_PROVIDERS_MODULES])
  File "C:\Program Files\Python36\lib\site-packages\faker\utils\loading.py", line 29, in find_available_providers
    providers = ['.'.join([providers_mod.__package__, mod]) for mod in list_module(providers_mod)]
  File "C:\Program Files\Python36\lib\site-packages\faker\utils\loading.py", line 7, in list_module
    path = os.path.dirname(module.__file__)
AttributeError: module 'faker.providers' has no attribute '__file__'


Discussion:
Hi @narendranani 

Can you try the `freeze` branch (https://github.com/joke2k/faker/tree/freeze) and tell me if the fix in there is working?
Hi @fcurella 

Thank you for quick response and sorry I didn't get you that what and where I have to implement that logic.

Resolving patch:
diff --git a/faker/utils/loading.py b/faker/utils/loading.py
--- a/faker/utils/loading.py
+++ b/faker/utils/loading.py
@@ -7,7 +7,10 @@
 def get_path(module):
     if getattr(sys, 'frozen', False):
         # frozen
-        path = os.path.dirname(sys.executable)
+        base_dir = os.path.dirname(sys.executable)
+        lib_dir = os.path.join(base_dir, "lib")
+        module_to_rel_path = os.path.join(*module.__package__.split("."))
+        path = os.path.join(lib_dir, module_to_rel_path)
     else:
         # unfrozen
         path = os.path.dirname(os.path.realpath(module.__file__))


Test patch:
Repository: joke2k/faker

Issue:
Visa now supports 19 digits credit card length
reference: 
https://www.freeformatter.com/credit-card-number-generator-validator.html 


Discussion:

Resolving patch:
diff --git a/faker/providers/credit_card/__init__.py b/faker/providers/credit_card/__init__.py
--- a/faker/providers/credit_card/__init__.py
+++ b/faker/providers/credit_card/__init__.py
@@ -44,6 +44,7 @@ class Provider(BaseProvider):
                                   prefix_mastercard, 16, security_code='CVV')),
         ('visa16', CreditCard('VISA 16 digit', prefix_visa)),
         ('visa13', CreditCard('VISA 13 digit', prefix_visa, 13)),
+        ('visa19', CreditCard('VISA 19 digit', prefix_visa, 19)),
         ('amex', CreditCard('American Express', prefix_amex,
                             15, security_code='CID', security_code_length=4)),
         ('discover', CreditCard('Discover', prefix_discover)),


Test patch:
Repository: joke2k/faker

Issue:
Generating invalid cpf (brazillian ssn)
Faker is generating invalid checksum digits for cpf (brazillian ssn).

### Steps to reproduce

1. Create fake instance using localization "pt_BR"
1. Call fake.cpf()

### Expected behavior

It should generate a valid CPF.

### Actual behavior

It is generating a CPF with invalid checksum digits, in some cases.



Discussion:

Resolving patch:
diff --git a/faker/providers/ssn/pt_BR/__init__.py b/faker/providers/ssn/pt_BR/__init__.py
--- a/faker/providers/ssn/pt_BR/__init__.py
+++ b/faker/providers/ssn/pt_BR/__init__.py
@@ -5,6 +5,12 @@
 
 
 def checksum(digits):
+    """
+    Returns the checksum of CPF digits.
+    References to the algorithm:
+    https://pt.wikipedia.org/wiki/Cadastro_de_pessoas_f%C3%ADsicas#Algoritmo
+    https://metacpan.org/source/MAMAWE/Algorithm-CheckDigits-v1.3.0/lib/Algorithm/CheckDigits/M11_004.pm
+    """
     s = 0
     p = len(digits) + 1
     for i in range(0, len(digits)):
@@ -13,7 +19,7 @@ def checksum(digits):
 
     reminder = s % 11
     if reminder == 0 or reminder == 1:
-        return 1
+        return 0
     else:
         return 11 - reminder
 


Test patch:
diff --git a/tests/providers/test_ssn.py b/tests/providers/test_ssn.py
--- a/tests/providers/test_ssn.py
+++ b/tests/providers/test_ssn.py
@@ -119,7 +119,7 @@ def setUp(self):
 
     def test_pt_BR_ssn_checksum(self):
         self.assertEqual(pt_checksum([8, 8, 2, 8, 2, 1, 6, 5, 2]), 2)
-        self.assertEqual(pt_checksum([8, 8, 2, 8, 2, 1, 6, 5, 2, 2]), 1)
+        self.assertEqual(pt_checksum([8, 8, 2, 8, 2, 1, 6, 5, 2, 2]), 0)
 
     def test_pt_BR_ssn(self):
         for _ in range(100):
Repository: joke2k/faker

Issue:
Norwegian ssn returns the wrong format for the date part 
SSN for no_NO returns the wrong format of the date part.

### Steps to reproduce

As @cloveras pointed out:
Using December 31 1999 as the date of birth (YYYYMMDD):
ssn('19991231','M')

This results in SSNs like these:
99123145123
99123108724
99123127532

### Expected behavior

The correct format is DDMMYY.

### Actual behavior

These start with the date of birth in YYMMDD format.



Discussion:

Resolving patch:
diff --git a/faker/providers/ssn/no_NO/__init__.py b/faker/providers/ssn/no_NO/__init__.py
--- a/faker/providers/ssn/no_NO/__init__.py
+++ b/faker/providers/ssn/no_NO/__init__.py
@@ -71,7 +71,7 @@ def ssn(self, dob=None, gender=None):
                 gender_num = self.generator.random.choice((0, 2, 4, 6, 8))
             elif gender == 'M':
                 gender_num = self.generator.random.choice((1, 3, 5, 7, 9))
-            pnr = birthday.strftime('%y%m%d') + suffix.zfill(2) + str(gender_num)
+            pnr = birthday.strftime('%d%m%y') + suffix.zfill(2) + str(gender_num)
             pnr_nums = [int(ch) for ch in pnr]
             k1 = checksum(Provider.scale1, pnr_nums)
             k2 = checksum(Provider.scale2, pnr_nums + [k1])


Test patch:
diff --git a/tests/providers/test_ssn.py b/tests/providers/test_ssn.py
--- a/tests/providers/test_ssn.py
+++ b/tests/providers/test_ssn.py
@@ -180,9 +180,11 @@ def test_no_NO_ssn(self):
             self.assertEqual(len(ssn), 11)
 
     def test_no_NO_ssn_dob_passed(self):
-        date_of_birth = '20010203'
-        ssn = self.factory.ssn(dob=date_of_birth)
-        self.assertEqual(ssn[:6], date_of_birth[2:])
+        test_data = [('20010203', '030201'),
+                     ('19991231', '311299')]
+        for date_of_birth, expected_dob_part in test_data:
+            ssn = self.factory.ssn(dob=date_of_birth)
+            self.assertEqual(ssn[:6], expected_dob_part)
 
     def test_no_NO_ssn_invalid_dob_passed(self):
         with self.assertRaises(ValueError):
Repository: joke2k/faker

Issue:
Add method to generate a cell phone number to pt-BR
Faker doesn't have a function to generate a cellphone to Brazilian.

Steps to reproduce
Create fake instance using localization "pt_BR"
Call fake.msisdn() or fake.phone_number()
Expected behavior
It should generate a cell phone number.

Actual behavior
Sometimes these methods return a "residential" numbers.

Reference difference between cell phones and residential numbers:

http://www.teleco.com.br/num.asp


Discussion:

Resolving patch:
diff --git a/faker/providers/phone_number/pt_BR/__init__.py b/faker/providers/phone_number/pt_BR/__init__.py
--- a/faker/providers/phone_number/pt_BR/__init__.py
+++ b/faker/providers/phone_number/pt_BR/__init__.py
@@ -71,6 +71,7 @@ class Provider(PhoneNumberProvider):
         '#### ####',
         '####-####',
     )
+
     msisdn_formats = (
         '5511#########',
         '5521#########',
@@ -81,3 +82,11 @@ class Provider(PhoneNumberProvider):
         '5571#########',
         '5581#########',
     )
+
+    cellphone_formats = (
+        '+55 9#### ####',
+    )
+
+    def cellphone_number(self):
+        pattern = self.random_element(self.cellphone_formats)
+        return self.numerify(self.generator.parse(pattern))


Test patch:
diff --git a/tests/providers/test_phone_number.py b/tests/providers/test_phone_number.py
--- a/tests/providers/test_phone_number.py
+++ b/tests/providers/test_phone_number.py
@@ -64,6 +64,12 @@ def test_msisdn_pt_br(self):
         assert msisdn.isdigit()
         assert msisdn[0:4] in formats
 
+    def test_cellphone_pt_br(self):
+        factory = Faker('pt_BR')
+        cellphone = factory.cellphone_number()
+        assert cellphone is not None
+        assert len(cellphone) == 14
+
 
 class TestHuHU(unittest.TestCase):