Commit 20b99970 authored by Casey Duncan's avatar Casey Duncan

Fix test so that is creates a new user folder, rather than borrowing the one *ac

tually in the root*. This could cause the tests to fail if you had a user folder with any users in it.
parent 61e05acc
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
"""User folder tests """User folder tests
""" """
__rcs_id__='$Id: testUserFolder.py,v 1.9 2004/01/30 16:58:45 Brian Exp $' __rcs_id__='$Id: testUserFolder.py,v 1.10 2004/04/29 21:17:06 caseman Exp $'
__version__='$Revision: 1.9 $'[11:-2] __version__='$Revision: 1.10 $'[11:-2]
import os, sys, base64, unittest import os, sys, base64, unittest
...@@ -26,7 +26,7 @@ Zope.startup() ...@@ -26,7 +26,7 @@ Zope.startup()
from AccessControl import Unauthorized from AccessControl import Unauthorized
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.User import BasicUserFolder from AccessControl.User import BasicUserFolder, UserFolder
from AccessControl.User import User from AccessControl.User import User
...@@ -37,7 +37,7 @@ class UserFolderTests(unittest.TestCase): ...@@ -37,7 +37,7 @@ class UserFolderTests(unittest.TestCase):
self.app = makerequest(Zope.app()) self.app = makerequest(Zope.app())
try: try:
# Set up a user and role # Set up a user and role
self.uf = self.app.acl_users self.uf = UserFolder().__of__(self.app)
self.uf._doAddUser('user1', 'secret', ['role1'], []) self.uf._doAddUser('user1', 'secret', ['role1'], [])
self.app._addRole('role1') self.app._addRole('role1')
self.app.manage_role('role1', ['View']) self.app.manage_role('role1', ['View'])
......
...@@ -10,8 +10,9 @@ ...@@ -10,8 +10,9 @@
# FOR A PARTICULAR PURPOSE # FOR A PARTICULAR PURPOSE
# #
############################################################################## ##############################################################################
'''$Id: DT_Util.py,v 1.91 2003/12/26 23:43:11 jeremy Exp $''' """DTML Utilities
__version__='$Revision: 1.91 $'[11:-2]
$Id: DT_Util.py,v 1.92 2004/04/29 21:17:08 caseman Exp $"""
import re import re
...@@ -19,6 +20,8 @@ from html_quote import html_quote, ustr # for import by other modules, dont remo ...@@ -19,6 +20,8 @@ from html_quote import html_quote, ustr # for import by other modules, dont remo
from RestrictedPython.Guards import safe_builtins from RestrictedPython.Guards import safe_builtins
from RestrictedPython.Utilities import utility_builtins from RestrictedPython.Utilities import utility_builtins
from RestrictedPython.Eval import RestrictionCapableEval from RestrictedPython.Eval import RestrictionCapableEval
from cDocumentTemplate import InstanceDict, TemplateDict, \
render_blocks, safe_callable, join_unicode
test = utility_builtins['test'] # for backwards compatibility, dont remove! test = utility_builtins['test'] # for backwards compatibility, dont remove!
...@@ -40,13 +43,6 @@ def int_param(params,md,name,default=0, st=type('')): ...@@ -40,13 +43,6 @@ def int_param(params,md,name,default=0, st=type('')):
v = int(v) v = int(v)
return v or 0 return v or 0
try:
from cDocumentTemplate import InstanceDict, TemplateDict, \
render_blocks, safe_callable, join_unicode
except:
from pDocumentTemplate import InstanceDict, TemplateDict, \
render_blocks, safe_callable, join_unicode
functype = type(int_param) functype = type(int_param)
class NotBindable: class NotBindable:
# Used to prevent TemplateDict from trying to bind to functions. # Used to prevent TemplateDict from trying to bind to functions.
......
...@@ -12,13 +12,21 @@ ...@@ -12,13 +12,21 @@
############################################################################## ##############################################################################
"""Python implementations of document template some features """Python implementations of document template some features
$Id: pDocumentTemplate.py,v 1.41 2002/09/24 22:25:57 jeremy Exp $""" XXX This module is no longer actively used, but is left as an
__version__='$Revision: 1.41 $'[11:-2] XXX implementation reference for cDocumentTemplate
$Id: pDocumentTemplate.py,v 1.42 2004/04/29 21:17:08 caseman Exp $"""
__version__='$Revision: 1.42 $'[11:-2]
import sys, types import sys, types
from types import StringType, UnicodeType, TupleType from types import StringType, UnicodeType, TupleType
from ustr import ustr from ustr import ustr
import warnings
warnings.warn('pDocumentTemplate is not longer in active use. '
'It remains only as an implementation reference.',
DeprecationWarning)
ClassTypes = [types.ClassType] ClassTypes = [types.ClassType]
try: try:
......
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