예제 #1
0
    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)
예제 #2
0
파일: test_fti.py 프로젝트: Vinsurya/Plone
    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)
예제 #3
0
 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)
예제 #4
0
    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)
예제 #5
0
    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)