prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Locale not respected for business.currency_iso_code()
  # Bug report
  
  ## What's wrong
  
  I'm trying to use mimesis to generate mock data for tests I'm going to develop and am writing [schema](https://mimesis.readthedocs.io/getting_started.html#schema-and-fields) to do so.
  
  I set the locale when instantiating an object of class `Field()`, but on calling `business.currency_iso_code()` I get random ISO currency codes, whilst I was expecting (or hoping!) to get those for the current locale.
  
      import random
      from mimesis.schema import Field, Schema
  
      class SlotData2():
          def __init__(self, locale, max_currency=10):
              self.field = Field(locale)
              self.max_currency = max_currency
  
          def _generate_cost(self):
              cost = (
                  lambda: {
                      'amount': self.field('business.price'),
                      'currency': self.field('business.currency_iso_code'),
                  }
              )
              cost_schema = Schema(schema=cost)
              return cost_schema.create(random.randint(1, self.max_currency))
  
  The `business.price` is always the correct locale, but the `business.currency_iso_code` varies as the following shows...
  
      In [200]: test2 = SlotData2('en-gb', 10)
      
      In [201]: test2._generate_cost()
      Out[201]: 
      [{'amount': '196.66 £', 'currency': 'BZD'},
       {'amount': '223.12 £', 'currency': 'VUV'}]
  
      In [202]: test2._generate_cost()
      Out[202]: 
      [{'amount': '626.08 £', 'currency': 'XCD'},
       {'amount': '904.78 £', 'currency': 'BOV'},
       {'amount': '836.96 £', 'currency': 'XUA'},
       {'amount': '529.19 £', 'currency': 'LYD'},
       {'amount': '341.14 £', 'currency': 'ILS'},
       {'amount': '136.68 £', 'currency': 'MGA'},
       {'amount': '691.84 £', 'currency': 'KHR'},
       {'amount': '493.02 £', 'currency': 'SDG'},
       {'amount': '250.04 £', 'currency': 'BGN'},
       {'amount': '649.36 £', 'currency': 'AUD'}]
      
      In [203]: test2._generate_cost()
      Out[203]: 
      [{'amount': '963.86 £', 'currency': 'MNT'},
       {'amount': '707.13 £', 'currency': 'TRY'},
       {'amount': '322.74 £', 'currency': 'SHP'}]
  
  I checked with `Generic('en-gb')` and it too returns random ISO currency codes rather than the expected `GBP`...
  
      In [204]: g = Generic('en-gb')
      
      In [205]: g.business.currency_iso_code()
      Out[205]: 'AFN'
      
      In [206]: g.business.currency_iso_code()
      Out[206]: 'USD'
      
      In [207]: g.business.currency_iso_code()
      Out[207]: 'ALL'
  
  
  ## How is that should be
  
  I would expect `business.currency_iso_code()` to return the code for the specified locale.
  
  ## System information
  
      python --version
      Python 3.6.7
      In [209]: mimesis.__version__
      Out[209]: '3.1.0'
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `mimesis/providers/business.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 
  3 """Business data provider."""
  4 
  5 from mimesis.data import (
  6     CRYPTOCURRENCY_ISO_CODES,
  7     CRYPTOCURRENCY_SYMBOLS,
  8     CURRENCY_ISO_CODES,
  9     CURRENCY_SYMBOLS,
  10 )
  11 from mimesis.providers.base import BaseDataProvider
  12 
  13 __all__ = ['Business']
  14 
  15 
  16 class Business(BaseDataProvider):
  17     """Class for generating data for business."""
  18 
  19     def __init__(self, *args, **kwargs):
  20         """Initialize attributes.
  21 
  22         :param locale: Current locale.
  23         """
  24         super().__init__(*args, **kwargs)
  25         self._datafile = 'business.json'
  26         self.pull(self._datafile)
  27 
  28     class Meta:
  29         """Class for metadata."""
  30 
  31         name = 'business'
  32 
  33     def company(self) -> str:
  34         """Get a random company name.
  35 
  36         :return: Company name.
  37         """
  38         return self.random.choice(self._data['company']['name'])
  39 
  40     def company_type(self, abbr: bool = False) -> str:
  41         """Get a random type of business entity.
  42 
  43         :param abbr: Abbreviated company type.
  44         :return: Types of business entity.
  45         """
  46         key = 'abbr' if abbr else 'title'
  47         return self.random.choice(
  48             self._data['company']['type'][key],
  49         )
  50 
  51     def copyright(self) -> str:  # noqa: A003
  52         """Generate a random copyright.
  53 
  54         :return: Copyright of company.
  55         """
  56         return '© {}, {}'.format(
  57             self.company(),
  58             self.company_type(abbr=True),
  59         )
  60 
  61     def currency_iso_code(self) -> str:
  62         """Get code of the currency.
  63 
  64         :return: Currency code.
  65         """
  66         return self.random.choice(CURRENCY_ISO_CODES)
  67 
  68     def cryptocurrency_iso_code(self) -> str:
  69         """Get symbol of random cryptocurrency.
  70 
  71         :return: Symbol of cryptocurrency.
  72         """
  73         return self.random.choice(CRYPTOCURRENCY_ISO_CODES)
  74 
  75     def currency_symbol(self):
  76         """Get a currency symbol for current locale.
  77 
  78         :return: Currency symbol.
  79         """
  80         return CURRENCY_SYMBOLS[self.locale]
  81 
  82     def cryptocurrency_symbol(self) -> str:
  83         """Get a cryptocurrency symbol.
  84 
  85         :return: Symbol of cryptocurrency.
  86         """
  87         return self.random.choice(CRYPTOCURRENCY_SYMBOLS)
  88 
  89     def price(self, minimum: float = 10.00,
  90               maximum: float = 1000.00) -> str:
  91         """Generate a random price.
  92 
  93         :param minimum: Max value of price.
  94         :param maximum: Min value of price.
  95         :return: Price.
  96         """
  97         price = self.random.uniform(minimum, maximum, precision=2)
  98         return '{0} {1}'.format(price, self.currency_symbol())
  99 
  100     def price_in_btc(self, minimum: float = 0, maximum: float = 2) -> str:
  101         """Generate random price in BTC.
  102 
  103         :param minimum: Minimum value of price.
  104         :param maximum: Maximum value of price.
  105         :return: Price in BTC.
  106         """
  107         return '{} BTC'.format(
  108             self.random.uniform(
  109                 minimum,
  110                 maximum,
  111                 precision=7,
  112             ),
  113         )
  114
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/mimesis/providers/business.py b/mimesis/providers/business.py
  --- a/mimesis/providers/business.py
  +++ b/mimesis/providers/business.py
  @@ -58,12 +58,16 @@
               self.company_type(abbr=True),
           )
   
  -    def currency_iso_code(self) -> str:
  -        """Get code of the currency.
  +    def currency_iso_code(self, allow_random: bool = False) -> str:
  +        """Get code of the currency for current locale.
   
  +        :param allow_random: Get a random ISO code.
           :return: Currency code.
           """
  -        return self.random.choice(CURRENCY_ISO_CODES)
  +        if allow_random:
  +            return self.random.choice(CURRENCY_ISO_CODES)
  +        else:
  +            return self._data['currency-code']
   
       def cryptocurrency_iso_code(self) -> str:
           """Get symbol of random cryptocurrency.
  
verification_info: {"golden_diff": "diff --git a/mimesis/providers/business.py b/mimesis/providers/business.py\n--- a/mimesis/providers/business.py\n+++ b/mimesis/providers/business.py\n@@ -58,12 +58,16 @@\n             self.company_type(abbr=True),\n         )\n \n-    def currency_iso_code(self) -> str:\n-        \"\"\"Get code of the currency.\n+    def currency_iso_code(self, allow_random: bool = False) -> str:\n+        \"\"\"Get code of the currency for current locale.\n \n+        :param allow_random: Get a random ISO code.\n         :return: Currency code.\n         \"\"\"\n-        return self.random.choice(CURRENCY_ISO_CODES)\n+        if allow_random:\n+            return self.random.choice(CURRENCY_ISO_CODES)\n+        else:\n+            return self._data['currency-code']\n \n     def cryptocurrency_iso_code(self) -> str:\n         \"\"\"Get symbol of random cryptocurrency.\n", "issue": "Locale not respected for business.currency_iso_code()\n# Bug report\r\n\r\n## What's wrong\r\n\r\nI'm trying to use mimesis to generate mock data for tests I'm going to develop and am writing [schema](https://mimesis.readthedocs.io/getting_started.html#schema-and-fields) to do so.\r\n\r\nI set the locale when instantiating an object of class `Field()`, but on calling `business.currency_iso_code()` I get random ISO currency codes, whilst I was expecting (or hoping!) to get those for the current locale.\r\n\r\n    import random\r\n    from mimesis.schema import Field, Schema\r\n\r\n    class SlotData2():\r\n        def __init__(self, locale, max_currency=10):\r\n            self.field = Field(locale)\r\n            self.max_currency = max_currency\r\n\r\n        def _generate_cost(self):\r\n            cost = (\r\n                lambda: {\r\n                    'amount': self.field('business.price'),\r\n                    'currency': self.field('business.currency_iso_code'),\r\n                }\r\n            )\r\n            cost_schema = Schema(schema=cost)\r\n            return cost_schema.create(random.randint(1, self.max_currency))\r\n\r\nThe `business.price` is always the correct locale, but the `business.currency_iso_code` varies as the following shows...\r\n\r\n    In [200]: test2 = SlotData2('en-gb', 10)\r\n    \r\n    In [201]: test2._generate_cost()\r\n    Out[201]: \r\n    [{'amount': '196.66 \u00a3', 'currency': 'BZD'},\r\n     {'amount': '223.12 \u00a3', 'currency': 'VUV'}]\r\n\r\n    In [202]: test2._generate_cost()\r\n    Out[202]: \r\n    [{'amount': '626.08 \u00a3', 'currency': 'XCD'},\r\n     {'amount': '904.78 \u00a3', 'currency': 'BOV'},\r\n     {'amount': '836.96 \u00a3', 'currency': 'XUA'},\r\n     {'amount': '529.19 \u00a3', 'currency': 'LYD'},\r\n     {'amount': '341.14 \u00a3', 'currency': 'ILS'},\r\n     {'amount': '136.68 \u00a3', 'currency': 'MGA'},\r\n     {'amount': '691.84 \u00a3', 'currency': 'KHR'},\r\n     {'amount': '493.02 \u00a3', 'currency': 'SDG'},\r\n     {'amount': '250.04 \u00a3', 'currency': 'BGN'},\r\n     {'amount': '649.36 \u00a3', 'currency': 'AUD'}]\r\n    \r\n    In [203]: test2._generate_cost()\r\n    Out[203]: \r\n    [{'amount': '963.86 \u00a3', 'currency': 'MNT'},\r\n     {'amount': '707.13 \u00a3', 'currency': 'TRY'},\r\n     {'amount': '322.74 \u00a3', 'currency': 'SHP'}]\r\n\r\nI checked with `Generic('en-gb')` and it too returns random ISO currency codes rather than the expected `GBP`...\r\n\r\n    In [204]: g = Generic('en-gb')\r\n    \r\n    In [205]: g.business.currency_iso_code()\r\n    Out[205]: 'AFN'\r\n    \r\n    In [206]: g.business.currency_iso_code()\r\n    Out[206]: 'USD'\r\n    \r\n    In [207]: g.business.currency_iso_code()\r\n    Out[207]: 'ALL'\r\n\r\n\r\n## How is that should be\r\n\r\nI would expect `business.currency_iso_code()` to return the code for the specified locale.\r\n\r\n## System information\r\n\r\n    python --version\r\n    Python 3.6.7\r\n    In [209]: mimesis.__version__\r\n    Out[209]: '3.1.0'\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n\"\"\"Business data provider.\"\"\"\n\nfrom mimesis.data import (\n    CRYPTOCURRENCY_ISO_CODES,\n    CRYPTOCURRENCY_SYMBOLS,\n    CURRENCY_ISO_CODES,\n    CURRENCY_SYMBOLS,\n)\nfrom mimesis.providers.base import BaseDataProvider\n\n__all__ = ['Business']\n\n\nclass Business(BaseDataProvider):\n    \"\"\"Class for generating data for business.\"\"\"\n\n    def __init__(self, *args, **kwargs):\n        \"\"\"Initialize attributes.\n\n        :param locale: Current locale.\n        \"\"\"\n        super().__init__(*args, **kwargs)\n        self._datafile = 'business.json'\n        self.pull(self._datafile)\n\n    class Meta:\n        \"\"\"Class for metadata.\"\"\"\n\n        name = 'business'\n\n    def company(self) -> str:\n        \"\"\"Get a random company name.\n\n        :return: Company name.\n        \"\"\"\n        return self.random.choice(self._data['company']['name'])\n\n    def company_type(self, abbr: bool = False) -> str:\n        \"\"\"Get a random type of business entity.\n\n        :param abbr: Abbreviated company type.\n        :return: Types of business entity.\n        \"\"\"\n        key = 'abbr' if abbr else 'title'\n        return self.random.choice(\n            self._data['company']['type'][key],\n        )\n\n    def copyright(self) -> str:  # noqa: A003\n        \"\"\"Generate a random copyright.\n\n        :return: Copyright of company.\n        \"\"\"\n        return '\u00a9 {}, {}'.format(\n            self.company(),\n            self.company_type(abbr=True),\n        )\n\n    def currency_iso_code(self) -> str:\n        \"\"\"Get code of the currency.\n\n        :return: Currency code.\n        \"\"\"\n        return self.random.choice(CURRENCY_ISO_CODES)\n\n    def cryptocurrency_iso_code(self) -> str:\n        \"\"\"Get symbol of random cryptocurrency.\n\n        :return: Symbol of cryptocurrency.\n        \"\"\"\n        return self.random.choice(CRYPTOCURRENCY_ISO_CODES)\n\n    def currency_symbol(self):\n        \"\"\"Get a currency symbol for current locale.\n\n        :return: Currency symbol.\n        \"\"\"\n        return CURRENCY_SYMBOLS[self.locale]\n\n    def cryptocurrency_symbol(self) -> str:\n        \"\"\"Get a cryptocurrency symbol.\n\n        :return: Symbol of cryptocurrency.\n        \"\"\"\n        return self.random.choice(CRYPTOCURRENCY_SYMBOLS)\n\n    def price(self, minimum: float = 10.00,\n              maximum: float = 1000.00) -> str:\n        \"\"\"Generate a random price.\n\n        :param minimum: Max value of price.\n        :param maximum: Min value of price.\n        :return: Price.\n        \"\"\"\n        price = self.random.uniform(minimum, maximum, precision=2)\n        return '{0} {1}'.format(price, self.currency_symbol())\n\n    def price_in_btc(self, minimum: float = 0, maximum: float = 2) -> str:\n        \"\"\"Generate random price in BTC.\n\n        :param minimum: Minimum value of price.\n        :param maximum: Maximum value of price.\n        :return: Price in BTC.\n        \"\"\"\n        return '{} BTC'.format(\n            self.random.uniform(\n                minimum,\n                maximum,\n                precision=7,\n            ),\n        )\n", "path": "mimesis/providers/business.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\n\"\"\"Business data provider.\"\"\"\n\nfrom mimesis.data import (\n    CRYPTOCURRENCY_ISO_CODES,\n    CRYPTOCURRENCY_SYMBOLS,\n    CURRENCY_ISO_CODES,\n    CURRENCY_SYMBOLS,\n)\nfrom mimesis.providers.base import BaseDataProvider\n\n__all__ = ['Business']\n\n\nclass Business(BaseDataProvider):\n    \"\"\"Class for generating data for business.\"\"\"\n\n    def __init__(self, *args, **kwargs):\n        \"\"\"Initialize attributes.\n\n        :param locale: Current locale.\n        \"\"\"\n        super().__init__(*args, **kwargs)\n        self._datafile = 'business.json'\n        self.pull(self._datafile)\n\n    class Meta:\n        \"\"\"Class for metadata.\"\"\"\n\n        name = 'business'\n\n    def company(self) -> str:\n        \"\"\"Get a random company name.\n\n        :return: Company name.\n        \"\"\"\n        return self.random.choice(self._data['company']['name'])\n\n    def company_type(self, abbr: bool = False) -> str:\n        \"\"\"Get a random type of business entity.\n\n        :param abbr: Abbreviated company type.\n        :return: Types of business entity.\n        \"\"\"\n        key = 'abbr' if abbr else 'title'\n        return self.random.choice(\n            self._data['company']['type'][key],\n        )\n\n    def copyright(self) -> str:  # noqa: A003\n        \"\"\"Generate a random copyright.\n\n        :return: Copyright of company.\n        \"\"\"\n        return '\u00a9 {}, {}'.format(\n            self.company(),\n            self.company_type(abbr=True),\n        )\n\n    def currency_iso_code(self, allow_random: bool = False) -> str:\n        \"\"\"Get code of the currency for current locale.\n\n        :param allow_random: Get a random ISO code.\n        :return: Currency code.\n        \"\"\"\n        if allow_random:\n            return self.random.choice(CURRENCY_ISO_CODES)\n        else:\n            return self._data['currency-code']\n\n    def cryptocurrency_iso_code(self) -> str:\n        \"\"\"Get symbol of random cryptocurrency.\n\n        :return: Symbol of cryptocurrency.\n        \"\"\"\n        return self.random.choice(CRYPTOCURRENCY_ISO_CODES)\n\n    def currency_symbol(self):\n        \"\"\"Get a currency symbol for current locale.\n\n        :return: Currency symbol.\n        \"\"\"\n        return CURRENCY_SYMBOLS[self.locale]\n\n    def cryptocurrency_symbol(self) -> str:\n        \"\"\"Get a cryptocurrency symbol.\n\n        :return: Symbol of cryptocurrency.\n        \"\"\"\n        return self.random.choice(CRYPTOCURRENCY_SYMBOLS)\n\n    def price(self, minimum: float = 10.00,\n              maximum: float = 1000.00) -> str:\n        \"\"\"Generate a random price.\n\n        :param minimum: Max value of price.\n        :param maximum: Min value of price.\n        :return: Price.\n        \"\"\"\n        price = self.random.uniform(minimum, maximum, precision=2)\n        return '{0} {1}'.format(price, self.currency_symbol())\n\n    def price_in_btc(self, minimum: float = 0, maximum: float = 2) -> str:\n        \"\"\"Generate random price in BTC.\n\n        :param minimum: Minimum value of price.\n        :param maximum: Maximum value of price.\n        :return: Price in BTC.\n        \"\"\"\n        return '{} BTC'.format(\n            self.random.uniform(\n                minimum,\n                maximum,\n                precision=7,\n            ),\n        )\n", "path": "mimesis/providers/business.py"}]}