diff --git a/test/integration/test_street_functions.py b/test/integration/test_street_functions.py index 9214c2f..1ce39b8 100644 --- a/test/integration/test_street_functions.py +++ b/test/integration/test_street_functions.py @@ -131,13 +131,31 @@ class TestBulkStreetFunctions(TestStreetFunctionsSetUp): ")_x', " \ "'''Logroño, La Rioja, Spain''')" response = self._run_authenticated(query) - # from nose.tools import set_trace; set_trace() assert_equal(response['total_rows'], 1) row_by_cartodb_id = self._row_by_cartodb_id(response) self._assert_x_y(row_by_cartodb_id[1], -2.4449852, 42.4627195) + def test_templating_geocoding(self): + query = "SELECT cartodb_id, st_x(the_geom), st_y(the_geom) from " \ + "cdb_dataservices_client.cdb_bulk_geocode_street_point(" \ + "'select 1 as cartodb_id, ''Logroño'' as city', " \ + "'city || '', '' || ''Spain''') " \ + "UNION " \ + "SELECT cartodb_id, st_x(the_geom), st_y(the_geom) from " \ + "cdb_dataservices_client.cdb_bulk_geocode_street_point(" \ + "'select 2 as cartodb_id, ''Logroño'' as city', " \ + "'city || '', '' || ''Argentina''')" + response = self._run_authenticated(query) + # from nose.tools import set_trace; set_trace() + + assert_equal(response['total_rows'], 2) + + row_by_cartodb_id = self._row_by_cartodb_id(response) + self._assert_x_y(row_by_cartodb_id[1], -2.4449852, 42.4627195) + self._assert_x_y(row_by_cartodb_id[2], -61.6961807, -29.5031057) + def _run_authenticated(self, query): authenticated_query = "{}&api_key={}".format(query,