def test_find_artist_accents(name): artist = Artist.objects.create(name=name, slug="foo") ArtistName.objects.create(artist=artist, name=name) assert find_artist_by_name('sia') == artist assert find_artist_by_name('Śìá') == artist assert find_artist_by_name('ŚÌÁ') == artist assert find_artist_by_name('śìá') == artist
def test_find_artist_reversed(): artist = Artist.objects.create(name="Alen Vitasović", slug="foo") ArtistName.objects.create(artist=artist, name="Alen Vitasović") assert find_artist_by_name('Vitasović Alen') == artist # Testing a bug which was fixed artist = Artist.objects.create(name="Jones Tom", slug="bar") ArtistName.objects.create(artist=artist, name="Jones Tom") assert find_artist_by_name('Tom Jones & Elvis presley') is None
def test_track_number_preceding_artist_name(): artist = Artist.objects.create(name="Elvis Costello", slug="foo") ArtistName.objects.create(artist=artist, name="Elvis Costello") assert find_artist_by_name('01 Elvis Costello') == artist assert find_artist_by_name('01. Elvis Costello') == artist assert find_artist_by_name('01.Elvis Costello') == artist assert find_artist_by_name('1.Elvis Costello') == artist assert find_artist_by_name('1 Elvis Costello') == artist assert find_artist_by_name('01-Elvis Costello') == artist assert find_artist_by_name('1-Elvis Costello') == artist
def test_find_artist_conjunctions(): artist = Artist.objects.create( name="Tamara Obrovac & Transhistria Electric", slug="foo") ArtistName.objects.create(artist=artist, name="Tamara Obrovac & Transhistria Electric") assert find_artist_by_name( 'Tamara Obrovac & Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac and Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac AND Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac i Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac I Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac + Transhistria Electric') == artist artist.delete() artist = Artist.objects.create( name="Tamara Obrovac i Transhistria Electric", slug="foo") ArtistName.objects.create(artist=artist, name="Tamara Obrovac i Transhistria Electric") assert find_artist_by_name( 'Tamara Obrovac & Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac and Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac AND Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac i Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac I Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac + Transhistria Electric') == artist artist.delete() artist = Artist.objects.create( name="Tamara Obrovac I Transhistria Electric", slug="foo") ArtistName.objects.create(artist=artist, name="Tamara Obrovac i Transhistria Electric") assert find_artist_by_name( 'Tamara Obrovac & Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac and Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac AND Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac i Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac I Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac + Transhistria Electric') == artist artist.delete() artist = Artist.objects.create( name="Tamara Obrovac and Transhistria Electric", slug="foo") ArtistName.objects.create(artist=artist, name="Tamara Obrovac and Transhistria Electric") assert find_artist_by_name( 'Tamara Obrovac & Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac and Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac AND Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac i Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac I Transhistria Electric') == artist assert find_artist_by_name( 'Tamara Obrovac + Transhistria Electric') == artist artist.delete()
def test_the_article_addition(): artist = Artist.objects.create(name="Queen", slug="foo") ArtistName.objects.create(artist=artist, name="Queen") assert find_artist_by_name('The Queen') == artist