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 @@
<head>
<p>[foo](bar/{})</p>
<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>
</head>
</body>
......
......@@ -14,9 +14,12 @@
import unittest
import zope.component.testing
from zope.component import provideUtility
from zope.traversing.adapters import DefaultTraversable
from Products.PageTemplates.tests import util
from Products.PageTemplates.PageTemplate import PageTemplate
from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver
from Products.PageTemplates.unicodeconflictresolver import DefaultUnicodeEncodingConflictResolver
from Acquisition import Implicit
from AccessControl import SecurityManager
from AccessControl.SecurityManagement import noSecurityManager
......@@ -50,6 +53,7 @@ class DTMLTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
def setUp(self):
super(DTMLTests, self).setUp()
zope.component.provideAdapter(DefaultTraversable, (None,))
provideUtility(DefaultUnicodeEncodingConflictResolver, IUnicodeEncodingConflictResolver)
self.t = AqPageTemplate()
self.policy = UnitTestSecurityPolicy()
......
......@@ -14,11 +14,14 @@
import unittest
import zope.component.testing
from zope.component import provideUtility
from zope.traversing.adapters import DefaultTraversable
from Products.PageTemplates.tests import util
from Products.PageTemplates.PageTemplate import PageTemplate
from Products.PageTemplates.GlobalTranslationService import \
setGlobalTranslationService
from Products.PageTemplates.interfaces import IUnicodeEncodingConflictResolver
from Products.PageTemplates.unicodeconflictresolver import DefaultUnicodeEncodingConflictResolver
from AccessControl import SecurityManager
from AccessControl.SecurityManagement import noSecurityManager
......@@ -67,6 +70,8 @@ class HTMLTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
super(HTMLTests, self).setUp()
zope.component.provideAdapter(DefaultTraversable, (None,))
provideUtility(DefaultUnicodeEncodingConflictResolver, IUnicodeEncodingConflictResolver)
self.folder = f = Folder()
f.laf = AqPageTemplate()
f.t = AqPageTemplate()
......
......@@ -15,6 +15,12 @@ class TypeSniffingTestCase(unittest.TestCase):
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):
if os.path.exists(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