Exemple #1
0
 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)
Exemple #2
0
 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)
Exemple #3
0
 def test_match_en(self):
     result = trans_span(self.context, self.trans_obj)
     self.assertEqual('English', result)
     self.assertIsInstance(result, Markup)
Exemple #4
0
 def test_canonical_html(self):
     result = trans_span(self.context, '<input>')
     self.assertEqual('<code>&lt;input&gt;</code>', result)
     self.assertIsInstance(result, Markup)
Exemple #5
0
 def test_canonical(self):
     result = trans_span(self.context, 'canonical string')
     self.assertEqual('<code>canonical string</code>', result)
     self.assertIsInstance(result, Markup)
Exemple #6
0
 def test_empty(self):
     result = trans_span(self.context, {})
     self.assertEqual(Markup(''), result)