From e376e294f57d332bf5fa63fa2915c32572be350f Mon Sep 17 00:00:00 2001 From: kialj876 Date: Fri, 22 Feb 2019 10:39:32 -0800 Subject: [PATCH] bug fixed with test (#530) Signed-off-by: Kial Jinnah --- api/namex/analytics/solr.py | 2 +- api/tests/python/end_points/test_synonym_match.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/api/namex/analytics/solr.py b/api/namex/analytics/solr.py index 4cec8afb6..65c18370c 100644 --- a/api/namex/analytics/solr.py +++ b/api/namex/analytics/solr.py @@ -296,8 +296,8 @@ def get_conflict_results(cls, name, bucket, start=0, rows=100): passed_names.append(name['name_info']['name']) no_duplicates = [] - duplicate = False for ordered in ordered_names: + duplicate = False for sorted in sorted_names: if ordered['name_info']['name'] == sorted['name_info']['name']: duplicate = True diff --git a/api/tests/python/end_points/test_synonym_match.py b/api/tests/python/end_points/test_synonym_match.py index fc0ca910a..3417a7d99 100644 --- a/api/tests/python/end_points/test_synonym_match.py +++ b/api/tests/python/end_points/test_synonym_match.py @@ -567,3 +567,13 @@ def test_synonym_clause_stemmed(client, jwt, app, query, ordered_list): seed_database_with(client, jwt, 'PACIFIC DEVELOPMENT', id='1', source='2') verify_order(client, jwt, query=query, expected_order=ordered_list) +@integration_postgres_solr +@integration_synonym_api +@integration_solr +@pytest.mark.parametrize("query, expected_list", [ + ('KM CONTRACTING', ['K & M CONSTRUCTION']), +]) +def test_number_synonyms(client, jwt, app, query, expected_list): + seed_database_with(client, jwt, 'K & M CONSTRUCTION', id='1', source='2') + verify_synonym_match(client, jwt, query=query, expected_list=expected_list) +