From a60c34bded88f00cfd4e9b2bb08168ca4de61316 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 17 Feb 2021 22:35:27 +0100 Subject: [PATCH] use a frozen DB for API tests This way we also test that dropping does the right thing. --- lib-php/website/details.php | 2 +- test/bdd/steps/nominatim_environment.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib-php/website/details.php b/lib-php/website/details.php index 8e350a8c..130dcaf8 100644 --- a/lib-php/website/details.php +++ b/lib-php/website/details.php @@ -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, '; diff --git a/test/bdd/steps/nominatim_environment.py b/test/bdd/steps/nominatim_environment.py index dd76dee3..0edb1159 100644 --- a/test/bdd/steps/nominatim_environment.py +++ b/test/bdd/steps/nominatim_environment.py @@ -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]) -- 2.39.5