Example #1
0
def get_lastfm_similar_artists(request, artistname, page=1):
  similar_artists=lastfm_manager.get_similar_artists(artistname,page)
  if(type(similar_artists)==str):
    params={'page':page, 'artistname':artistname.replace("+"," ").title()}
  else:
    params={'artists':similar_artists,'artistname':artistname.replace("+"," ").title(),'page':page}
  return render_to_response('similar_artists.html',params,context_instance=RequestContext(request))
Example #2
0
 def test_get_similar_artists(self):
   response=lastfm_manager.get_similar_artists("Portishead","1")
   self.assertTrue(type(response)==dict, "The response should be a dict")
   self.assertEquals(response['similarartists']['@attr']['artist'],"Portishead")