def test_description_i18n(self): fti = DexterityFTI('testtype', description='t\xc3\xa9st') # with no i18n domain, we get the UTF8-encoded title self.assertEqual('t\xc3\xa9st', fti.Description()) # with an i18n domain, we get a Message fti.i18n_domain = 'test' msgid = fti.Description() self.assertEqual('t\xe9st', msgid) self.assertEqual('test', msgid.domain)
def test_description_i18n(self): fti = DexterityFTI(u'testtype', description='t\xc3\xa9st') # with no i18n domain, we get the UTF8-encoded title self.assertEqual('t\xc3\xa9st', fti.Description()) # with an i18n domain, we get a Message fti.i18n_domain = 'test' msgid = fti.Description() self.assertEqual(u't\xe9st', msgid) self.assertEqual('test', msgid.domain)
def test_title_i18n(self): fti = DexterityFTI(u'testtype', title='t\xc3\xa9st') # with no i18n domain, we get the UTF8-encoded title self.assertEquals('t\xc3\xa9st', fti.Title()) # with an i18n domain, we get a Message fti.i18n_domain = 'test' msgid = fti.Title() self.assertEquals(u't\xe9st', msgid) self.assertEquals('test', msgid.domain)
def test_description_i18n(self): fti = DexterityFTI(u"testtype", description="t\xc3\xa9st") # with no i18n domain, we get the UTF8-encoded title self.assertEquals("t\xc3\xa9st", fti.Description()) # with an i18n domain, we get a Message fti.i18n_domain = "test" msgid = fti.Description() self.assertEquals(u"t\xe9st", msgid) self.assertEquals("test", msgid.domain)
def test_title_i18n(self): fti = DexterityFTI(u'testtype', title=b't\xc3\xa9st') # with no i18n domain, we get the UTF8-encoded title self.assertEqual(b't\xc3\xa9st'.decode('utf8'), fti.Title()) # with an i18n domain, we get a Message fti.i18n_domain = 'test' msgid = fti.Title() self.assertEqual(u't\xe9st', msgid) self.assertEqual('test', msgid.domain)