def test_search_facet_display_translated(self): en_us = LanguageTag(code='en_US', name='English - United States') zh_cn = LanguageTag(code='zh_CN', name='Chinese - Traditional') en_us.set_current_language('es') zh_cn.set_current_language('es') zh_cn.name_t = 'Chino - Tradicional' en_us.name_t = 'Inglés - Estados Unidos' assert en_us.get_search_facet_display(translate=True) == 'Inglés' assert zh_cn.get_search_facet_display(translate=True) == 'Chino - Tradicional'
def test_search_facet_display_untranslated(self): en_us = LanguageTag(code='en_US', name='English - United States') zh_cn = LanguageTag(code='zh_CN', name='Chinese - Traditional') en_us.set_current_language('es') zh_cn.set_current_language('es') en_us.name_t = 'Inglés - Estados Unidos' zh_cn.name_t = 'Chino - Tradicional' self.assertEqual(en_us.get_search_facet_display(), 'English') self.assertEqual(zh_cn.get_search_facet_display(), 'Chinese - Traditional')