- assert wid[0] in res[h], "Missing term for %s/%s: %s" % (row['object'], h, wid[1])
- elif h != 'object':
- assert db_row.contains(h, row[h]), db_row.assert_msg(h, row[h])
+ assert present, "Missing term for {}/{}: {}".fromat(row['object'], name, wid[1])
+ elif name != 'object':
+ assert db_row.contains(name, value), db_row.assert_msg(name, value)
+
+@then("search_name has no entry for (?P<oid>.*)")
+def check_search_name_has_entry(context, oid):
+ """ Check that there is noentry in the search_name table for the given
+ objects. IDs are in format '<NRW><osm id>[:<class>]'.
+ """
+ with context.db.cursor(cursor_factory=psycopg2.extras.DictCursor) as cur:
+ NominatimID(oid).row_by_place_id(cur, 'search_name')
+
+ assert cur.rowcount == 0, \
+ "Found {} entries for ID {}".format(cur.rowcount, oid)