Пример #1
0
 def test_no_match(self):
     self.context['lang'] = 'ru'
     result = pick_translation(self.context, self.trans_obj)
     self.assertEqual(('English', 'en'), result)
Пример #2
0
 def test_match_es(self):
     self.context['lang'] = 'es'
     result = pick_translation(self.context, self.trans_obj)
     self.assertEqual(('Español', 'es'), result)
Пример #3
0
 def test_match_en(self):
     result = pick_translation(self.context, self.trans_obj)
     self.assertEqual(('English', 'en'), result)
Пример #4
0
 def test_canonical_html(self):
     result = pick_translation(self.context, '<input>')
     self.assertEqual(('<input>', None), result)
Пример #5
0
 def test_canonical(self):
     result = pick_translation(self.context, 'canonical string')
     self.assertEqual(('canonical string', None), result)
Пример #6
0
 def test_empty(self):
     result = pick_translation(self.context, {})
     self.assertEqual(('', None), result)