def test_no_match(self): self.context['lang'] = 'ru' result = trans_span(self.context, self.trans_obj) self.assertEqual('<span lang="en">English</span>', result) self.assertIsInstance(result, Markup)
def test_match_es(self): self.context['lang'] = 'es' result = trans_span(self.context, self.trans_obj) self.assertEqual('Español', result) self.assertIsInstance(result, Markup)
def test_match_en(self): result = trans_span(self.context, self.trans_obj) self.assertEqual('English', result) self.assertIsInstance(result, Markup)
def test_canonical_html(self): result = trans_span(self.context, '<input>') self.assertEqual('<code><input></code>', result) self.assertIsInstance(result, Markup)
def test_canonical(self): result = trans_span(self.context, 'canonical string') self.assertEqual('<code>canonical string</code>', result) self.assertIsInstance(result, Markup)
def test_empty(self): result = trans_span(self.context, {}) self.assertEqual(Markup(''), result)