diff --git a/geolocation/geocode/models.py b/geolocation/geocode/models.py index f9d6da9..1c71af7 100644 --- a/geolocation/geocode/models.py +++ b/geolocation/geocode/models.py @@ -2,7 +2,6 @@ class LocationModel(object): - _administrative_area = list() def __init__(self, **kwargs): self.city = kwargs.get('city') @@ -14,6 +13,7 @@ def __init__(self, **kwargs): self.lat = kwargs.get('lat') self.lng = kwargs.get('lng') self.formatted_address = kwargs.get('formatted_address') + self._administrative_area = list() def __repr__(self): return '' % self.city @@ -35,4 +35,4 @@ def __init__(self, area_type, name): self.name = name def __repr__(self): - return '' % self.name \ No newline at end of file + return '' % self.name diff --git a/tests/tests.py b/tests/tests.py index 2194e44..aa25322 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -123,6 +123,15 @@ def test_latlng(self): self.assertEqual('Mountain View', my_location.city.decode('utf-8')) + def test_administrative_area_resets(self): + address = "São Paulo" + sao_paulo = self.google_maps.search(address).first() + + address = "Houston, TX" + houston = self.google_maps.search(address).first() + + self.assertNotEqual(sao_paulo, houston) + class DistanceMatrixTest(unittest.TestCase): def setUp(self): @@ -212,4 +221,8 @@ def test_distance_matrix_avoid_ferries(self): self.assertEqual(item.distance.kilometers, 1851) self.assertEqual(item.distance.meters, 1851000) self.assertEqual(item.distance.miles, 1150.1559) - self.assertEqual(str(item.duration), '0d 17h 35m 44s') \ No newline at end of file + self.assertEqual(str(item.duration), '0d 17h 35m 44s') + + +if __name__ == '__main__': + unittest.main()