X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/c3788d765ed4e7ddf00794085af757714bc102cf..23dabad0b0c8c1ffd9b4973bfc9e1d739e6128d7:/test/python/tools/test_migration.py?ds=sidebyside diff --git a/test/python/tools/test_migration.py b/test/python/tools/test_migration.py index 8fef0dc1..d102b97d 100644 --- a/test/python/tools/test_migration.py +++ b/test/python/tools/test_migration.py @@ -14,6 +14,8 @@ from nominatim.tools import migration from nominatim.errors import UsageError import nominatim.version +from mock_legacy_word_table import MockLegacyWordTable + class DummyTokenizer: def update_sql_functions(self, config): @@ -26,6 +28,10 @@ def postprocess_mock(monkeypatch): monkeypatch.setattr(migration.tokenizer_factory, 'get_tokenizer_for_db', lambda *args: DummyTokenizer()) +@pytest.fixture +def legacy_word_table(temp_db_conn): + return MockLegacyWordTable(temp_db_conn) + def test_no_migration_old_versions(temp_db_with_extensions, table_factory, def_config): table_factory('country_name', 'name HSTORE, country_code TEXT') @@ -156,7 +162,7 @@ def test_add_nominatim_property_table_repeat(temp_db_conn, temp_db_cursor, def test_change_housenumber_transliteration(temp_db_conn, temp_db_cursor, - word_table, placex_table): + legacy_word_table, placex_table): placex_table.add(housenumber='3A') temp_db_cursor.execute("""CREATE OR REPLACE FUNCTION make_standard_name(name TEXT)