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