'Test that LoncapaSystem has an i18n that works.'

@mock.patch('capa.responsetypes.log')
def test_responsetype_i18n(self, mock_log):

    staff_ans = 'clearly    bad    syntax    )[+1e'
    problem = self.build_problem(answer=staff_ans, tolerance=0.001)
    class FakeTranslations(object, ):
        'A    fake    gettext.Translations    object.'
        def ugettext(self, text):
            "Return    the    'translation'    of    `text`."
            if (text == 'There    was    a    problem    with    the    staff    answer    to    this    problem.'):
                text = 'TRANSLATED!'
            return text
    problem.capa_system.i18n = FakeTranslations()
    with self.assertRaisesRegexp(StudentInputError, 'TRANSLATED!'):
        self.assert_grade(problem, '1+j', 'correct')
