'Test that the xblock_handler rewrites static handout links'

def test_course_handouts_rewrites(self):

    handouts = self.store.create_item(self.user.id, self.course.id, 'course_info', 'handouts', fields={'data': "<a    href='/static/handouts/sample_handout.txt'>Sample</a>"})
    resp = self.client.get(get_url('xblock_handler', handouts.location))
    self.assertEqual(resp.status_code, 200)
    asset_key = self.course.id.make_asset_key('asset', 'handouts_sample_handout.txt')
    self.assertContains(resp, unicode(asset_key))
