Merge pull request #426 from CartoDB/425-Fixed_country_code_problem

Fixed country code problem
This commit is contained in:
Mario de Frutos 2018-01-16 16:44:12 +01:00 committed by GitHub
commit 72b99a1729
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -66,6 +66,8 @@ class MapboxGeocoder(Traceable):
if state_province:
address.append(state_province)
country = [country] if country else None
try:
response = self._geocoder.forward(address=', '.join(address),
country=country,

View File

@ -29,3 +29,8 @@ class MapboxGeocoderTestCase(unittest.TestCase):
place = self.geocoder.geocode(searchtext='Barcelona')
assert place
def test_valid_request_namedplace2(self):
place = self.geocoder.geocode(searchtext='New York', country='us')
assert place