]> git.openstreetmap.org Git - nominatim.git/commitdiff
use a frozen DB for API tests
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 17 Feb 2021 21:35:27 +0000 (22:35 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 17 Feb 2021 21:35:27 +0000 (22:35 +0100)
This way we also test that dropping does the right thing.

lib-php/website/details.php
test/bdd/steps/nominatim_environment.py

index 8e350a8c65a86fb2121482985b16dede2ee7d1e1..130dcaf81e92945f126969497f405ed216035142 100644 (file)
@@ -53,7 +53,7 @@ if ($sOsmType && $iOsmId > 0) {
 
     // Be nice about our error messages for broken geometry
 
-    if (!$sPlaceId) {
+    if (!$sPlaceId && $oDB->tableExists('import_polygon_error')) {
         $sSQL = 'SELECT ';
         $sSQL .= '    osm_type, ';
         $sSQL .= '    osm_id, ';
index dd76dee3fbcced1ee9688d7ffae53d75c2d65718..0edb115980bd564ddac04a8b2070fb73d505e1de 100644 (file)
@@ -182,6 +182,7 @@ class NominatimEnvironment:
         try:
             self.run_setup_script('all', osm_file=self.api_test_file)
             self.run_setup_script('import-tiger-data')
+            self.run_setup_script('drop')
 
             phrase_file = str((testdata / 'specialphrases_testdb.sql').resolve())
             run_script(['psql', '-d', self.api_test_db, '-f', phrase_file])