Example #1
0
class TestEsES(unittest.TestCase):
    """ Tests in addresses in the fa_IR locale """
    def setUp(self):
        self.fake = Faker('es_ES')
        Faker.seed(0)

    def test_state_name(self):
        state_name = self.fake.state_name()
        assert isinstance(state_name, str)
        assert state_name in EsEsProvider.states

    def test_street_prefix(self):
        street_prefix = self.fake.street_prefix()
        assert isinstance(street_prefix, str)
        assert street_prefix in EsEsProvider.street_prefixes

    def test_secondary_address(self):
        secondary_address = self.fake.secondary_address()
        assert isinstance(secondary_address, str)

    def test_regions(self):
        region = self.fake.region()
        assert isinstance(region, str)
        assert region in EsEsProvider.regions

        # Spanish regions, also known as "autonomous communities"
        autonomous_community = self.fake.autonomous_community()
        assert isinstance(autonomous_community, str)
        assert autonomous_community in EsEsProvider.regions