コード例 #1
0
    def test_configuration(self):
        document_jsonconfig_url = '/plone/document/@@tinymce-jsonconfiguration'
        output = self.portal.restrictedTraverse(document_jsonconfig_url)('text')
        self.assertIn('buttons', output)

        # If we configure directivity to 'auto', the directivity is set depending
        # on the content language.
        utility = form_adapter(self.portal)
        utility.directionality = 'auto'
        doc = self.portal[self.document]
        self.assertEqual(doc.Language(), 'en')
        output = self.portal.restrictedTraverse(document_jsonconfig_url)('text')
        self.assertIn('"directionality": "ltr"', output)
        doc.setLanguage('ar')
        output = self.portal.restrictedTraverse(document_jsonconfig_url)('text')
        self.assertIn('"directionality": "rtl"', output)
コード例 #2
0
    def test_configuration(self):
        document_jsonconfig_url = '/plone/document/@@tinymce-jsonconfiguration'
        output = self.portal.restrictedTraverse(document_jsonconfig_url)(
            'text')
        self.assertIn('buttons', output)

        # If we configure directivity to 'auto', the directivity is set depending
        # on the content language.
        utility = form_adapter(self.portal)
        utility.directionality = 'auto'
        doc = self.portal[self.document]
        self.assertEqual(doc.Language(), 'en')
        output = self.portal.restrictedTraverse(document_jsonconfig_url)(
            'text')
        self.assertIn('"directionality": "ltr"', output)
        doc.setLanguage('ar')
        output = self.portal.restrictedTraverse(document_jsonconfig_url)(
            'text')
        self.assertIn('"directionality": "rtl"', output)
コード例 #3
0
 def setUp(self):
     super(UtilityTestCase, self).setUp()
     self.utility = form_adapter(self.portal)
コード例 #4
0
 def setUp(self):
     super(UtilityTestCase, self).setUp()
     self.utility = form_adapter(self.portal)