Repository: joke2k/faker
Pull request #1146 (2020-04-04 15:56:52)

Added bank provider for es_ES locale.


Patch:
diff --git a/faker/providers/bank/es_ES/__init__.py b/faker/providers/bank/es_ES/__init__.py
new file mode 100644
index 00000000..807d57e4
--- /dev/null
+++ b/faker/providers/bank/es_ES/__init__.py
@@ -0,0 +1,6 @@
+from .. import Provider as BankProvider
+
+
+class Provider(BankProvider):
+    bban_format = '####################'
+    country_code = 'ES'
diff --git a/faker/providers/color/fr_FR/__init__.py b/faker/providers/color/fr_FR/__init__.py
index 261201b1..b46314fc 100644
--- a/faker/providers/color/fr_FR/__init__.py
+++ b/faker/providers/color/fr_FR/__init__.py
@@ -65,7 +65,7 @@ class Provider(ColorProvider):
         ("Beige antique", "#FAEBD7"),
         ("Beige papaye", "#FFEFD5"),
         ("Amande", "#FFEBCD"),
-        ("Bisque", "#ffe4c4"),
+        ("Bisque", "#FFE4C4"),
         ("Beige pêche", "#FFDAB9"),
         ("Beige mocassin", "#FFE4B5"),
         ("Jaune blanc navaro", "#FFDEAD"),
diff --git a/faker/providers/color/hy_AM/__init__.py b/faker/providers/color/hy_AM/__init__.py
index 2dfa2cdb..65fa5cc6 100644
--- a/faker/providers/color/hy_AM/__init__.py
+++ b/faker/providers/color/hy_AM/__init__.py
@@ -37,7 +37,7 @@ class Provider(ColorProvider):
         ("Գունատ փիրուզագույն", "#AFEEEE"),
         ("Գրասենյակային կանաչ", "#008000"),
         ("Դարչնագույն ավազ", "#F4A460"),
-        ("Դարչնագույն", "#964b00"),
+        ("Դարչնագույն", "#964B00"),
         ("Դեղին", "#FFFF00"),
         ("Դեղձի կրեմ", "#FFDAB9"),
         ("Դեղնականաչ", "#9ACD3"),
diff --git a/faker/providers/color/pt_BR/__init__.py b/faker/providers/color/pt_BR/__init__.py
index a3a2d949..593bbb8e 100644
--- a/faker/providers/color/pt_BR/__init__.py
+++ b/faker/providers/color/pt_BR/__init__.py
@@ -50,7 +50,7 @@ class Provider(ColorProvider):
         ("Azul flor de milho", "#6495ED"),
         ("Azul força aérea", "#5D8AA8"),
         ("Azul furtivo", "#1E90FF"),
-        ("Azul manteiga", "#a6aa3e"),
+        ("Azul manteiga", "#A6AA3E"),
         ("Azul marinho", "#120A8F"),
         ("Azul médio", "#0000CD"),
         ("Azul meia-noite", "#191970"),
@@ -152,7 +152,7 @@ class Provider(ColorProvider):
         ("Marrom claro", "#A52A2A"),
         ("Marrom rosado", "#BC8F8F"),
         ("Marrom sela", "#8B4513"),
-        ("Marrom", "#964b00"),
+        ("Marrom", "#964B00"),
         ("Milho Claro", "#FFF8DC"),
         ("Milho", "#FBEC5D"),
         ("Mocassim", "#FFE4B5"),


Test patch:
diff --git a/tests/providers/test_bank.py b/tests/providers/test_bank.py
index a6cc524d..2ed83dee 100644
--- a/tests/providers/test_bank.py
+++ b/tests/providers/test_bank.py
@@ -110,3 +110,19 @@ class TestPtPt(unittest.TestCase):
     def test_iban(self):
         iban = self.fake.iban()
         assert re.match(r"PT\d{21}", iban)
+
+
+class TestEsES(unittest.TestCase):
+    """Tests the bank provider for es_ES locale"""
+
+    def setUp(self):
+        self.fake = Faker('es_ES')
+        Faker.seed(0)
+
+    def test_bban(self):
+        bban = self.fake.bban()
+        assert re.match(r"\d{20}", bban)
+
+    def test_iban(self):
+        iban = self.fake.iban()
+        assert re.match(r"ES\d{22}", iban)