Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
9b54c26e
Commit
9b54c26e
authored
Nov 02, 2005
by
Florent Guillaume
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run standalone, and do proper setup/teardown.
parent
9a6cedc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
lib/python/OFS/tests/testObjectManager.py
lib/python/OFS/tests/testObjectManager.py
+12
-5
No files found.
lib/python/OFS/tests/testObjectManager.py
View file @
9b54c26e
...
...
@@ -3,12 +3,16 @@ import unittest
from
AccessControl.Owned
import
EmergencyUserCannotOwn
from
AccessControl.SecurityManagement
import
newSecurityManager
from
AccessControl.SecurityManagement
import
noSecurityManager
from
AccessControl.User
import
User
# before SpecialUsers
from
AccessControl.SpecialUsers
import
emergency_user
,
nobody
,
system
from
AccessControl.User
import
User
from
Acquisition
import
Implicit
from
App.config
import
getConfiguration
from
OFS.ObjectManager
import
ObjectManager
from
OFS.SimpleItem
import
SimpleItem
from
zope.app.testing.placelesssetup
import
PlacelessSetup
import
Products.Five
from
Products.Five
import
zcml
from
Products.Five.eventconfigure
import
setDeprecatedManageAddDelete
class
FauxRoot
(
Implicit
):
...
...
@@ -53,23 +57,26 @@ class ItemForDeletion(SimpleItem):
def
manage_afterClone
(
self
,
item
):
pass
from
Products.Five.eventconfigure
import
setDeprecatedManageAddDelete
setDeprecatedManageAddDelete
(
ItemForDeletion
)
from
zope.interface
import
implements
from
OFS.interfaces
import
IItem
class
ObjectManagerWithIItem
(
ObjectManager
):
"""The event subscribers work on IItem."""
implements
(
IItem
)
class
ObjectManagerTests
(
unittest
.
TestCase
):
class
ObjectManagerTests
(
PlacelessSetup
,
unittest
.
TestCase
):
def
setUp
(
self
):
super
(
ObjectManagerTests
,
self
).
setUp
()
self
.
saved_cfg_debug_mode
=
getConfiguration
().
debug_mode
zcml
.
load_config
(
'meta.zcml'
,
Products
.
Five
)
zcml
.
load_config
(
'event.zcml'
,
Products
.
Five
)
zcml
.
load_config
(
'deprecated.zcml'
,
Products
.
Five
)
setDeprecatedManageAddDelete
(
ItemForDeletion
)
def
tearDown
(
self
):
noSecurityManager
()
getConfiguration
().
debug_mode
=
self
.
saved_cfg_debug_mode
super
(
ObjectManagerTests
,
self
).
tearDown
()
def
setDebugMode
(
self
,
mode
):
getConfiguration
().
debug_mode
=
mode
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment