"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Zope2/App/tests/test_safe_formatter.py" between
Zope-5.2.tar.gz and Zope-5.2.1.tar.gz

About: Zope Z Object Publishing Environment - web application platform used for building content management systems, intranets, portals, and custom applications.

test_safe_formatter.py  (Zope-5.2):test_safe_formatter.py  (Zope-5.2.1)
skipping to change at line 176 skipping to change at line 176
# Zope 3 templates are always file system templates. So we actually have # Zope 3 templates are always file system templates. So we actually have
# no problems allowing str.format there. # no problems allowing str.format there.
def test_cook_zope3_page_templates_normal(self): def test_cook_zope3_page_templates_normal(self):
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
pt = ViewPageTemplateFile('normal_zope3_page_template.pt') pt = ViewPageTemplateFile('normal_zope3_page_template.pt')
hack_pt(pt) hack_pt(pt)
# Need to pass a namespace. # Need to pass a namespace.
namespace = {'context': self.app} namespace = {'context': self.app}
self.assertEqual( self.assertEqual(
pt.pt_render(namespace).strip(), pt.pt_render(namespace).strip().replace('\r\n', '\n'),
'<p>&lt;application at &gt;</p>\n' '<p>&lt;application at &gt;</p>\n'
'<p>&lt;APPLICATION AT &gt;</p>') '<p>&lt;APPLICATION AT &gt;</p>')
def test_cook_zope3_page_templates_using_format(self): def test_cook_zope3_page_templates_using_format(self):
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
pt = ViewPageTemplateFile('using_format_zope3_page_template.pt') pt = ViewPageTemplateFile('using_format_zope3_page_template.pt')
hack_pt(pt) hack_pt(pt)
# Need to pass a namespace. # Need to pass a namespace.
namespace = {'context': self.app} namespace = {'context': self.app}
# Even when one of the accessed items requires a role that we do # Even when one of the accessed items requires a role that we do
# not have, we get no Unauthorized, because this is a filesystem # not have, we get no Unauthorized, because this is a filesystem
# template. # template.
self.app.test_folder_1_.__roles__ = ['Manager'] self.app.test_folder_1_.__roles__ = ['Manager']
self.assertEqual( self.assertEqual(
pt.pt_render(namespace).strip(), pt.pt_render(namespace).strip().replace('\r\n', '\n'),
"<p>class of &lt;application at &gt; is " "<p>class of &lt;application at &gt; is "
"&lt;class 'ofs.application.application'&gt;</p>\n" "&lt;class 'ofs.application.application'&gt;</p>\n"
"<p>CLASS OF &lt;APPLICATION AT &gt; IS " "<p>CLASS OF &lt;APPLICATION AT &gt; IS "
"&lt;CLASS 'OFS.APPLICATION.APPLICATION'&gt;</p>\n" "&lt;CLASS 'OFS.APPLICATION.APPLICATION'&gt;</p>\n"
"<p>{'foo': &lt;Folder at /test_folder_1_&gt;} has " "<p>{'foo': &lt;Folder at /test_folder_1_&gt;} has "
"foo=&lt;Folder at test_folder_1_&gt;</p>\n" "foo=&lt;Folder at test_folder_1_&gt;</p>\n"
"<p>{'foo': &lt;Folder at /test_folder_1_&gt;} has " "<p>{'foo': &lt;Folder at /test_folder_1_&gt;} has "
"foo=&lt;Folder at test_folder_1_&gt;</p>\n" "foo=&lt;Folder at test_folder_1_&gt;</p>\n"
"<p>[&lt;Folder at /test_folder_1_&gt;] has " "<p>[&lt;Folder at /test_folder_1_&gt;] has "
"first item &lt;Folder at test_folder_1_&gt;</p>\n" "first item &lt;Folder at test_folder_1_&gt;</p>\n"
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)