Commit 7a14524a authored by Hanno Schlichting's avatar Hanno Schlichting

Got rid of PythonScripts test dependency in DocumentTemplate

parent a61b86e2
......@@ -54,7 +54,3 @@ DocumentTemplate
configuration via zope.conf. The calls are localized to one function each.
Add an optional dependency on Zope2? Configure if it is available,
otherwise use some default?
- Test only dependencies:
* Products.PythonScripts
......@@ -17,15 +17,29 @@ import unittest
from DocumentTemplate import HTML
from DocumentTemplate.tests.testDTML import DTMLTests
from Products.PythonScripts.standard import DTML
from DocumentTemplate.security import RestrictedDTML
from AccessControl import Unauthorized
from AccessControl.SecurityManagement import getSecurityManager
from ExtensionClass import Base
class UnownedDTML(DTML):
class UnownedDTML(RestrictedDTML, HTML):
def getOwner(self):
return None
class SecurityTests (DTMLTests):
def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw):
"""Render the DTML"""
security = getSecurityManager()
security.addContext(self)
try:
return HTML.__call__(self, client, REQUEST, **kw)
finally:
security.removeContext(self)
class SecurityTests(DTMLTests):
doc_class = UnownedDTML
unrestricted_doc_class = HTML
......
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