Commit 8730ec04 authored by Andreas Jung's avatar Andreas Jung

merged fixes from HEAD in order to make "zopectl test"

properly with the UnicodeEncodingConflictResolver configured through ZCML
parent 412dd0b2
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<p>[foo](bar/{})</p> <p>[foo](bar/{})</p>
<a href="foo" alt="[default](alttext/{})">link</a> <a href="foo" alt="[default](alttext/{})">link</a>
<p>[dom](${name} was born in ${country}./{'country':'Antarctica','name':'Lomax'})</p> <p>[dom](${name} was born in ${country}./{'country':u'Antarctica','name':u'Lomax'})</p>
<p>[default](hmm/{'age':u'25'})</p> <p>[default](hmm/{'age':u'25'})</p>
</head> </head>
</body> </body>
......
...@@ -14,9 +14,12 @@ ...@@ -14,9 +14,12 @@
import unittest import unittest
import zope.component.testing import zope.component.testing
from zope.component import provideUtility
from zope.traversing.adapters import DefaultTraversable from zope.traversing.adapters import DefaultTraversable
from Products.PageTemplates.tests import util from Products.PageTemplates.tests import util
from Products.PageTemplates.PageTemplate import PageTemplate from Products.PageTemplates.PageTemplate import PageTemplate
from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver
from Products.PageTemplates.unicodeconflictresolver import DefaultUnicodeEncodingConflictResolver
from Acquisition import Implicit from Acquisition import Implicit
from AccessControl import SecurityManager from AccessControl import SecurityManager
from AccessControl.SecurityManagement import noSecurityManager from AccessControl.SecurityManagement import noSecurityManager
...@@ -50,6 +53,7 @@ class DTMLTests(zope.component.testing.PlacelessSetup, unittest.TestCase): ...@@ -50,6 +53,7 @@ class DTMLTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
def setUp(self): def setUp(self):
super(DTMLTests, self).setUp() super(DTMLTests, self).setUp()
zope.component.provideAdapter(DefaultTraversable, (None,)) zope.component.provideAdapter(DefaultTraversable, (None,))
provideUtility(DefaultUnicodeEncodingConflictResolver, IUnicodeEncodingConflictResolver)
self.t = AqPageTemplate() self.t = AqPageTemplate()
self.policy = UnitTestSecurityPolicy() self.policy = UnitTestSecurityPolicy()
......
...@@ -14,11 +14,14 @@ ...@@ -14,11 +14,14 @@
import unittest import unittest
import zope.component.testing import zope.component.testing
from zope.component import provideUtility
from zope.traversing.adapters import DefaultTraversable from zope.traversing.adapters import DefaultTraversable
from Products.PageTemplates.tests import util from Products.PageTemplates.tests import util
from Products.PageTemplates.PageTemplate import PageTemplate from Products.PageTemplates.PageTemplate import PageTemplate
from Products.PageTemplates.GlobalTranslationService import \ from Products.PageTemplates.GlobalTranslationService import \
setGlobalTranslationService setGlobalTranslationService
from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver
from Products.PageTemplates.unicodeconflictresolver import DefaultUnicodeEncodingConflictResolver
from AccessControl import SecurityManager from AccessControl import SecurityManager
from AccessControl.SecurityManagement import noSecurityManager from AccessControl.SecurityManagement import noSecurityManager
...@@ -67,6 +70,8 @@ class HTMLTests(zope.component.testing.PlacelessSetup, unittest.TestCase): ...@@ -67,6 +70,8 @@ class HTMLTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
super(HTMLTests, self).setUp() super(HTMLTests, self).setUp()
zope.component.provideAdapter(DefaultTraversable, (None,)) zope.component.provideAdapter(DefaultTraversable, (None,))
provideUtility(DefaultUnicodeEncodingConflictResolver, IUnicodeEncodingConflictResolver)
self.folder = f = Folder() self.folder = f = Folder()
f.laf = AqPageTemplate() f.laf = AqPageTemplate()
f.t = AqPageTemplate() f.t = AqPageTemplate()
......
...@@ -15,6 +15,12 @@ class TypeSniffingTestCase(unittest.TestCase): ...@@ -15,6 +15,12 @@ class TypeSniffingTestCase(unittest.TestCase):
TEMPFILENAME = tempfile.mktemp(".zpt") TEMPFILENAME = tempfile.mktemp(".zpt")
def setUp(self):
from zope.component import provideUtility
from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver
from Products.PageTemplates.unicodeconflictresolver import DefaultUnicodeEncodingConflictResolver
provideUtility(DefaultUnicodeEncodingConflictResolver, IUnicodeEncodingConflictResolver)
def tearDown(self): def tearDown(self):
if os.path.exists(self.TEMPFILENAME): if os.path.exists(self.TEMPFILENAME):
os.unlink(self.TEMPFILENAME) os.unlink(self.TEMPFILENAME)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment