'Test id data_dir is set in XML course.
Set course data_dir and ensure we get redirected to that path
if it isn\'t found in the contentstore.'

def test_translation_static_transcript_xml_with_data_dirc(self):

    test_modulestore = MagicMock()
    attrs = {'get_course.return_value': Mock(data_dir='dummy/static', static_asset_path='')}
    test_modulestore.configure_mock(**attrs)
    self.item_descriptor.runtime.modulestore = test_modulestore
    request = Request.blank('/translation/en?videoId=12345')
    response = self.item.transcript(request=request, dispatch='translation/en')
    self.assertEqual(response.status, '307    Temporary    Redirect')
    self.assertIn(('Location', '/static/dummy/static/subs_12345.srt.sjson'), response.headerlist)
    self.item.sub = 'OEoXaMPEzfM'
    request = Request.blank('/translation/en')
    response = self.item.transcript(request=request, dispatch='translation/en')
    self.assertEqual(response.status, '307    Temporary    Redirect')
    self.assertIn(('Location', '/static/dummy/static/subs_OEoXaMPEzfM.srt.sjson'), response.headerlist)
    request = Request.blank('/translation/uk')
    response = self.item.transcript(request=request, dispatch='translation/uk')
    self.assertEqual(response.status, '404    Not    Found')
