Skip to content

Commit

Permalink
bug fixed with test (#530)
Browse files Browse the repository at this point in the history
Signed-off-by: Kial Jinnah <[email protected]>
  • Loading branch information
kialj876 authored and katiemcgoff committed Feb 22, 2019
1 parent 59bba39 commit e376e29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/namex/analytics/solr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions api/tests/python/end_points/test_synonym_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit e376e29

Please sign in to comment.