- ))
- f.write("@define('CONST_Osm2pgsql_Flatnode_File', null);\n")
- f.write("@define('CONST_Import_Style', CONST_BasePath.'/settings/import-full.style');\n")
- f.close()
+ )
+
+ if self.website_dir is not None \
+ and self.test_env is not None \
+ and dsn == self.test_env['NOMINATIM_DATABASE_DSN']:
+ return # environment already set uo
+
+ self.test_env = os.environ
+ self.test_env['NOMINATIM_DATABASE_DSN'] = dsn
+ self.test_env['NOMINATIM_FLATNODE_FILE'] = ''
+ self.test_env['NOMINATIM_IMPORT_STYLE'] = 'full'
+ self.test_env['NOMINATIM_USE_US_TIGER_DATA'] = 'yes'
+
+ if self.website_dir is not None:
+ self.website_dir.cleanup()
+
+ self.website_dir = tempfile.TemporaryDirectory()
+ self.run_setup_script('setup-website')