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
aaeb9477
Commit
aaeb9477
authored
Apr 28, 2005
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed _refreshSkinData() helper to work with CMF >= 1.5.
parent
f9f42abf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
16 deletions
+14
-16
lib/python/Testing/ZopeTestCase/PortalTestCase.py
lib/python/Testing/ZopeTestCase/PortalTestCase.py
+5
-4
lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
+3
-2
lib/python/Testing/ZopeTestCase/testPortalTestCase.py
lib/python/Testing/ZopeTestCase/testPortalTestCase.py
+6
-10
No files found.
lib/python/Testing/ZopeTestCase/PortalTestCase.py
View file @
aaeb9477
...
...
@@ -95,11 +95,12 @@ class PortalTestCase(base.TestCase):
self
.
folder
=
pm
.
getHomeFolder
(
user_name
)
def
_refreshSkinData
(
self
):
'''Refreshes the magic _v_skindata attribute.'''
if
hasattr
(
self
.
portal
,
'_v_skindata'
):
'''Refreshes the skin cache.'''
if
hasattr
(
self
.
portal
,
'clearCurrentSkin'
):
self
.
portal
.
clearCurrentSkin
()
else
:
# CMF 1.4
self
.
portal
.
_v_skindata
=
None
if
hasattr
(
self
.
portal
,
'setupCurrentSkin'
):
self
.
portal
.
setupCurrentSkin
()
self
.
portal
.
setupCurrentSkin
()
# Portal interface
...
...
lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
View file @
aaeb9477
...
...
@@ -8,8 +8,9 @@
- Removed doctest.py, we now use the one from zope.testing.
- Removed dochttp.py + test, we now use the one from zope.app.tests.
- ZopeLite now takes care not to monkey patch an already started Zope.
- PortalTestCase no longer calls _refreshSkinData() as CMF is smart enough
now (and CMF 1.5+ does not work that way anyway).
- PortalTestCase.setUp() no longer calls _refreshSkinData() as CMF is smart
enough now.
- Fixed _refreshSkinData() helper to work with CMF >= 1.5.
- Fixed a bug where using sessions in sandboxed (functional) tests would cause
connection pool depletion and subsequent hangs. Thanks to Balazs Ree.
...
...
lib/python/Testing/ZopeTestCase/testPortalTestCase.py
View file @
aaeb9477
...
...
@@ -48,15 +48,16 @@ from OFS.SimpleItem import SimpleItem
from
OFS.Folder
import
Folder
class
DummyPortal
(
Folder
):
_v_skindata
=
None
def
__init__
(
self
,
id
):
self
.
id
=
id
self
.
_addRole
(
'Member'
)
self
.
_setObject
(
'portal_membership'
,
DummyMembershipTool
())
self
.
manage_addFolder
(
'Members'
)
self
.
_called
=
[]
def
clearCurrentSkin
(
self
):
self
.
_called
.
append
(
'clearCurrentSkin'
)
def
setupCurrentSkin
(
self
):
if
self
.
_v_skindata
is
None
:
self
.
_v_skindata
=
'refreshed'
self
.
_called
.
append
(
'setupCurrentSkin'
)
class
DummyMembershipTool
(
SimpleItem
):
id
=
'portal_membership'
...
...
@@ -148,12 +149,11 @@ class TestPortalTestCase(ZopeTestCase.PortalTestCase):
self
.
assertEqual
(
owner_info
,
([
portal_name
,
'acl_users'
],
user_name
))
def
test_refreshSkinData
(
self
):
# The
_v_skindata attribut
e should be refreshed
# The
skin cach
e should be refreshed
self
.
app
=
self
.
_app
()
self
.
portal
=
self
.
getPortal
()
self
.
assertEqual
(
self
.
portal
.
_v_skindata
,
None
)
self
.
_refreshSkinData
()
self
.
assertEqual
(
self
.
portal
.
_
v_skindata
,
'refreshed'
)
self
.
assertEqual
(
self
.
portal
.
_
called
,
[
'clearCurrentSkin'
,
'setupCurrentSkin'
]
)
def
test_setRoles
(
self
):
# Roles should be set for user
...
...
@@ -320,8 +320,6 @@ class TestPortalTestCase(ZopeTestCase.PortalTestCase):
# XXX: Changed in 0.9.0
#self.assertEqual(self._called, ['afterClear', 'beforeSetUp', 'afterSetUp'])
self
.
assertEqual
(
self
.
_called
,
[
'beforeSetUp'
,
'afterSetUp'
])
# XXX: Changed in 0.9.7
#self.assertEqual(self.portal._v_skindata, 'refreshed')
def
test_tearDown
(
self
):
# Everything should be removed
...
...
@@ -344,8 +342,6 @@ class TestPortalTestCase(ZopeTestCase.PortalTestCase):
# XXX: Changed in 0.9.0
#self.assertEqual(self._called, ['afterClear', 'beforeSetUp', 'afterSetUp'])
self
.
assertEqual
(
self
.
_called
,
[
'beforeSetUp'
,
'afterSetUp'
])
# XXX: Changed in 0.9.7
#self.assertEqual(self.portal._v_skindata, 'refreshed')
# This is crazy
...
...
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