Repository: joke2k/faker

Issue:
en_CA should implement postcode, not postalcode
All of the address providers use `postcode` to generate post codes. This is misspelled as `postalcode` by the localization for `en_CA`. 


### Expected behavior

It would be easier to use faker in a multilingual context if this were spelled consistently.

Recommended fix: provide a courtesy alias definition of `postcode` so that CA works the same as everyone else. Perhaps `postalcode` should be deprecated, too.

### Actual behavior

```bash
$ grep -r "{{postalcode}}" * | grep -v ".pyc"
providers/address/en_CA/__init__.py:        "{{street_address}}\n{{city}}, {{province_abbr}} {{postalcode}}",


$ grep -r "{{postcode}}" * | grep -v ".pyc"
providers/address/fa_IR/__init__.py:        "{{street_address}}\n{{city}}, {{state}} {{postcode}}",
providers/address/fi_FI/__init__.py:    address_formats = ("{{street_address}}\n{{postcode}} {{city}}", )
providers/address/nl_BE/__init__.py:        "{{street_address}}\n{{postcode}}\n{{city}}",
providers/address/nl_BE/__init__.py:        "{{street_address}}\n{{postcode}} {{city}}",
providers/address/sk_SK/__init__.py:    address_formats = ('{{street_address}}\n{{postcode}} {{city}}', )
providers/address/uk_UA/__init__.py:    address_formats = ['{{street_address}}, {{city}}, {{postcode}}']
providers/address/en_US/__init__.py:        "{{street_address}}\n{{city}}, {{state_abbr}} {{postcode}}",
providers/address/en_US/__init__.py:        ("{{street_address}}\n{{city}}, {{state_abbr}} {{postcode}}", 25),
providers/address/en_US/__init__.py:        ("{{military_apo}}\nAPO {{military_state}} {{postcode}}", 1),
providers/address/en_US/__init__.py:        ("{{military_ship}} {{last_name}}\nFPO {{military_state}} {{postcode}}", 1),
providers/address/en_US/__init__.py:        ("{{military_dpo}}\nDPO {{military_state}} {{postcode}}", 1),
providers/address/ne_NP/__init__.py:        "{{street_name}} {{building_prefix}} {{building_number}} \n{{city}}\n{{district}} {{postcode}}",
providers/address/sv_SE/__init__.py:    address_formats = ("{{street_address}}\n{{postcode}} {{city}}", )
providers/address/id_ID/__init__.py:        '{{street_address}}\n{{city}}, {{state}} {{postcode}}',
providers/address/id_ID/__init__.py:        '{{street_address}}\n{{city}}, {{state_abbr}} {{postcode}}',
providers/address/pt_BR/__init__.py:        "{{street_address}}\n{{bairro}}\n{{postcode}} {{city}} / {{estado_sigla}}", )
providers/address/it_IT/__init__.py:        "{{street_address}}\n{{city}}, {{postcode}} {{state}} ({{state_abbr}})",
providers/address/zh_TW/__init__.py:        "{{postcode}} {{city}}{{street_address}}{{secondary_address}}", )
providers/address/pt_PT/__init__.py:        "{{street_address}}\n{{postcode}} {{city}}",
providers/address/hr_HR/__init__.py:    address_formats = ('{{street_address}}\n{{postcode}} {{city}}', )
providers/address/cs_CZ/__init__.py:    address_formats = ('{{street_address}}\n{{postcode}} {{city}}', )
providers/address/__init__.py:    address_formats = ('{{street_address}} {{postcode}} {{city}}', )
providers/address/fr_CH/__init__.py:    address_formats = ("{{street_address}}\n{{postcode}} {{city}}",)
providers/address/he_IL/__init__.py:    address_formats = ('{{street_address}}, {{city}}, {{postcode}}', )
providers/address/hi_IN/__init__.py:    address_formats = ('{{street_address}}\n{{city}} {{postcode}}',
providers/address/hi_IN/__init__.py:                       '{{street_address}}\n{{city}}-{{postcode}}',)
providers/address/sl_SI/__init__.py:    address_formats = ('{{street_address}}\n{{postcode}} {{city}}', )
providers/address/zh_CN/__init__.py:        "{{province}}{{city}}{{district}}{{street_address}} {{postcode}}",)
providers/address/nl_NL/__init__.py:        "{{street_address}}\n{{postcode}}\n{{city}}",
providers/address/hu_HU/__init__.py:    address_formats = ("{{street_address}}\n{{postcode}} {{city}}",)
providers/address/en_AU/__init__.py:        "{{street_address}}\n{{city}}, {{state_abbr}}, {{postcode}}", )
providers/address/en_GB/__init__.py:        "{{street_address}}\n{{city}}\n{{postcode}}",
providers/address/es_MX/__init__.py:        "{{street_address}}\n{{city}}, {{state_abbr}} {{postcode}}",
providers/address/ru_RU/__init__.py:    address_formats = ('{{city}}, {{street_address}}, {{postcode}}', )
providers/address/es_ES/__init__.py:        "{{street_address}}\n{{city}}, {{postcode}}",
providers/address/el_GR/__init__.py:        "{{street_address}},\n{{postcode}} {{city}}",
providers/address/el_GR/__init__.py:        "{{street_address}}, {{postcode}} {{city}}",
providers/address/no_NO/__init__.py:    address_formats = ('{{street_address}}, {{postcode}} {{city}}',)
providers/address/pl_PL/__init__.py:        "{{street_address}}\n{{postcode}} {{city}}",
providers/address/fr_FR/__init__.py:        "{{street_address}}\n{{postcode}} {{city}}",
providers/address/de_AT/__init__.py:    address_formats = ('{{street_address}}\n{{postcode}} {{city}}', )
providers/address/de_DE/__init__.py:    address_formats = ('{{street_address}}\n{{postcode}} {{city}}', )


```

Discussion:

Patch:
diff --git a/faker/providers/address/en_CA/__init__.py b/faker/providers/address/en_CA/__init__.py
index 4d8963ed..7e7e989a 100644
--- a/faker/providers/address/en_CA/__init__.py
+++ b/faker/providers/address/en_CA/__init__.py
@@ -316,7 +316,7 @@ class Provider(AddressProvider):
         """
         return self.random_element(self.postal_code_letters)
 
-    def postalcode(self):
+    def postcode(self):
         """
         Replaces all question mark ('?') occurrences with a random letter
         from postal_code_formats then passes result to
@@ -326,3 +326,6 @@ class Provider(AddressProvider):
                       lambda x: self.postal_code_letter(),
                       self.random_element(self.postal_code_formats))
         return self.numerify(temp)
+    
+    def postalcode(self):
+        return self.postcode()
diff --git a/faker/providers/address/en_US/__init__.py b/faker/providers/address/en_US/__init__.py
index c15c771a..451d5d72 100644
--- a/faker/providers/address/en_US/__init__.py
+++ b/faker/providers/address/en_US/__init__.py
@@ -332,7 +332,7 @@ class Provider(AddressProvider):
     def state_abbr(self):
         return self.random_element(self.states_abbr)
 
-    def zipcode(self):
+    def postcode(self):
         return "%05d" % self.generator.random.randint(501, 99950)
 
     def zipcode_plus4(self):
@@ -364,8 +364,11 @@ class Provider(AddressProvider):
         return self.numerify(self.military_dpo_format)
 
     # Aliases
+    def zipcode(self):
+        return self.postcode()
+
     def postalcode(self):
-        return self.zipcode()
+        return self.postcode()
 
     def postalcode_plus4(self):
         return self.zipcode_plus4()
diff --git a/faker/providers/address/ja_JP/__init__.py b/faker/providers/address/ja_JP/__init__.py
index 3444e6a1..9d08197f 100644
--- a/faker/providers/address/ja_JP/__init__.py
+++ b/faker/providers/address/ja_JP/__init__.py
@@ -347,9 +347,12 @@ class Provider(AddressProvider):
         """
         return self.random_element(self.building_names)
 
-    def zipcode(self):
+    def postcode(self):
         """
         :example '101-1212'
         """
         return "%03d-%04d" % (self.generator.random.randint(0, 999),
                               self.generator.random.randint(0, 9999))
+
+    def zipcode(self):
+        return self.postcode()
diff --git a/faker/providers/address/ko_KR/__init__.py b/faker/providers/address/ko_KR/__init__.py
index 0a0ee206..956f7e11 100644
--- a/faker/providers/address/ko_KR/__init__.py
+++ b/faker/providers/address/ko_KR/__init__.py
@@ -381,8 +381,14 @@ class Provider(AddressProvider):
         """
         return self.bothify(self.random_element(self.postcode_formats))
 
-    def postal_code(self):
+    def postcode(self):
         """
         :example 12345
         """
         return self.bothify(self.random_element(self.new_postal_code_formats))
+
+    def postal_code(self):
+        """
+        :example 12345
+        """
+        return self.postcode()


Test patch:
diff --git a/tests/providers/test_address.py b/tests/providers/test_address.py
index e7385664..585e0869 100644
--- a/tests/providers/test_address.py
+++ b/tests/providers/test_address.py
@@ -230,6 +230,12 @@ class TestEnCA(unittest.TestCase):
     def setUp(self):
         self.factory = Faker('en_CA')
 
+    def test_postcode(self):
+        for _ in range(100):
+            postcode = self.factory.postcode()
+            assert re.match("[A-Z][0-9][A-Z] ?[0-9][A-Z][0-9]",
+                            postcode)
+
     def test_postalcode(self):
         for _ in range(100):
             postalcode = self.factory.postalcode()
@@ -292,6 +298,11 @@ class TestEnUS(unittest.TestCase):
         assert isinstance(state_abbr, string_types)
         assert state_abbr in EnUsProvider.states_abbr
 
+    def test_postcode(self):
+        for _ in range(100):
+            postcode = self.factory.postcode()
+            assert re.match("\d{5}", postcode)
+
     def test_zipcode(self):
         for _ in range(100):
             zipcode = self.factory.zipcode()
@@ -420,6 +431,10 @@ class TestJaJP(unittest.TestCase):
         assert isinstance(building_name, string_types)
         assert building_name in JaProvider.building_names
 
+        postcode = self.factory.postcode()
+        assert isinstance(postcode, string_types)
+        assert re.match("\d{3}-\d{4}", postcode)
+
         zipcode = self.factory.zipcode()
         assert isinstance(zipcode, string_types)
         assert re.match("\d{3}-\d{4}", zipcode)
@@ -428,6 +443,26 @@ class TestJaJP(unittest.TestCase):
         assert isinstance(address, string_types)
 
 
+class TestKoKR(unittest.TestCase):
+    """ Tests addresses in the ko_KR locale """
+
+    def setUp(self):
+        self.factory = Faker('ko_KR')
+
+    def test_address(self):
+        postcode = self.factory.postcode()
+        assert isinstance(postcode, string_types)
+        assert re.match("\d{5}", postcode)
+
+        postal_code = self.factory.postal_code()
+        assert isinstance(postal_code, string_types)
+        assert re.match("\d{5}", postal_code)
+
+        old_postal_code = self.factory.old_postal_code()
+        assert isinstance(old_postal_code, string_types)
+        assert re.match("\d{3}-\d{3}", old_postal_code)
+
+
 class TestNeNP(unittest.TestCase):
     """ Tests addresses in the ne_NP locale """