Skip to content

Commit

Permalink
Add test for accented character search
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnesbitt committed Jan 27, 2025
1 parent ae03bdd commit a9fc509
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dandiapi/api/tests/test_dandiset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,22 @@ def test_dandiset_rest_search_identifier(api_client, draft_version):
assert results[0]['draft_version']['name'] == draft_version.name


@pytest.mark.django_db
def test_dandiset_rest_search_accented_characters(api_client, draft_version_factory):
dv = draft_version_factory()
dv.metadata['contributor'][0]['name'] = 'Buzsáki, György'
dv.save()

assert (
api_client.get('/api/dandisets/', {'search': 'György'}).data['results']
== api_client.get('/api/dandisets/', {'search': 'Gyorgy'}).data['results']
)
assert (
api_client.get('/api/dandisets/', {'search': 'Buzsáki'}).data['results']
== api_client.get('/api/dandisets/', {'search': 'Buzsaki'}).data['results']
)


@pytest.mark.django_db
@pytest.mark.parametrize(
'contributors',
Expand Down

0 comments on commit a9fc509

Please sign in to comment.