This repository was archived by the owner on Oct 26, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,14 @@ def __call__(self):
5959 'code' : '404' ,
6060 'message' : "No object found for path '%s'." % path ,
6161 }
62- try :
63- text = obj .getText ()
64- except AttributeError :
62+
63+ # process rich text
64+ text = getattr (obj , 'text' , None )
65+ if text is not None :
66+ text = text .output
67+ else :
6568 text = ''
69+
6670 return {
6771 'route' : path ,
6872 'id' : obj .id ,
Original file line number Diff line number Diff line change 66from zope .interface import directlyProvides
77from zope .component import getMultiAdapter
88
9+ from plone .app .textfield .value import RichTextValue
910from plone .app .angularjs .interfaces import IAPIRequest
1011
1112import unittest2 as unittest
@@ -69,6 +70,11 @@ def test_traversal_not_found(self):
6970
7071 def test_traversal_document (self ):
7172 self .portal .invokeFactory ('Document' , 'doc1' )
73+ self .portal .doc1 .text = RichTextValue (
74+ u"Lorem ipsum." ,
75+ 'text/plain' ,
76+ 'text/html'
77+ )
7278 self .request .set ('path' , 'doc1' )
7379
7480 view = getMultiAdapter (
@@ -82,7 +88,7 @@ def test_traversal_document(self):
8288 u'route' : u'/plone/doc1' ,
8389 u'title' : u'' ,
8490 u'description' : u'' ,
85- u'text' : u'' ,
91+ u'text' : u'<p>Lorem ipsum.</p> ' ,
8692 u'id' : u'doc1'
8793 }
8894 )
You can’t perform that action at this time.
0 commit comments