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)
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)
def setUp(self): super(UtilityTestCase, self).setUp() self.utility = form_adapter(self.portal)