mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
add fixtures for country table
This commit is contained in:
@@ -53,11 +53,10 @@ def test_setup_country_tables(src_dir, temp_db_with_extensions, dsn, temp_db_cur
|
||||
|
||||
@pytest.mark.parametrize("languages", (None, ['fr', 'en']))
|
||||
def test_create_country_names(temp_db_with_extensions, temp_db_conn, temp_db_cursor,
|
||||
table_factory, tokenizer_mock, languages, loaded_country):
|
||||
|
||||
table_factory('country_name', 'country_code varchar(2), name hstore',
|
||||
content=(('us', '"name"=>"us1","name:af"=>"us2"'),
|
||||
('fr', '"name"=>"Fra", "name:en"=>"Fren"')))
|
||||
country_row, tokenizer_mock, languages, loaded_country):
|
||||
temp_db_cursor.execute('TRUNCATE country_name')
|
||||
country_row(country='us', names={"name": "us1", "name:af": "us2"})
|
||||
country_row(country='fr', names={"name": "Fra", "name:en": "Fren"})
|
||||
|
||||
assert temp_db_cursor.scalar("SELECT count(*) FROM country_name") == 2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user