@@ -69,7 +69,7 @@ async def test__admin_boundary_lookup_sql_country() -> None:
6969 )
7070 assert sql == (
7171 "SELECT gid_0, gid_1, gid_2, country, name_1, name_2 FROM some_dataset"
72- " WHERE country=' some_country' AND adm_level='0'"
72+ " WHERE country=$country$ some_country$country$ AND adm_level='0'"
7373 )
7474
7575
@@ -80,8 +80,8 @@ async def test__admin_boundary_lookup_sql_country_region() -> None:
8080 )
8181 assert sql == (
8282 "SELECT gid_0, gid_1, gid_2, country, name_1, name_2 FROM some_dataset"
83- " WHERE country=' some_country' "
84- " AND name_1=' some_region' "
83+ " WHERE country=$country$ some_country$country$ "
84+ " AND name_1=$region$ some_region$region$ "
8585 " AND adm_level='1'"
8686 )
8787
@@ -93,9 +93,9 @@ async def test__admin_boundary_lookup_sql_all() -> None:
9393 )
9494 assert sql == (
9595 "SELECT gid_0, gid_1, gid_2, country, name_1, name_2 FROM some_dataset"
96- " WHERE country=' some_country' "
97- " AND name_1=' some_region' "
98- " AND name_2=' some_subregion' "
96+ " WHERE country=$country$ some_country$country$ "
97+ " AND name_1=$region$ some_region$region$ "
98+ " AND name_2=$subregion$ some_subregion$subregion$ "
9999 " AND adm_level='2'"
100100 )
101101
@@ -107,9 +107,23 @@ async def test__admin_boundary_lookup_sql_all_normalized() -> None:
107107 )
108108 assert sql == (
109109 "SELECT gid_0, gid_1, gid_2, country, name_1, name_2 FROM some_dataset"
110- " WHERE country_normalized='some_country'"
111- " AND name_1_normalized='some_region'"
112- " AND name_2_normalized='some_subregion'"
110+ " WHERE country_normalized=$country$some_country$country$"
111+ " AND name_1_normalized=$region$some_region$region$"
112+ " AND name_2_normalized=$subregion$some_subregion$subregion$"
113+ " AND adm_level='2'"
114+ )
115+
116+
117+ @pytest .mark .asyncio
118+ async def test__admin_boundary_lookup_sql_no_single_quotes () -> None :
119+ sql = _admin_boundary_lookup_sql (
120+ 2 , False , "some_dataset" , "Côte d'Ivoire" , "some_region" , "some_subregion"
121+ )
122+ assert sql == (
123+ "SELECT gid_0, gid_1, gid_2, country, name_1, name_2 FROM some_dataset"
124+ " WHERE country=$country$Côte d'Ivoire$country$"
125+ " AND name_1=$region$some_region$region$"
126+ " AND name_2=$subregion$some_subregion$subregion$"
113127 " AND adm_level='2'"
114128 )
115129
0 commit comments