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
4ee18b66
Commit
4ee18b66
authored
Jun 07, 2005
by
Florent Guillaume
Browse files
Options
Browse Files
Download
Plain Diff
Merge from 2.8 branch r30675:
Collector #1803: Fixed InitializeClass for some corner case.
parents
83f054fa
9191a342
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
2 deletions
+50
-2
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/App/class_init.py
lib/python/App/class_init.py
+2
-2
lib/python/App/tests/test_class_init.py
lib/python/App/tests/test_class_init.py
+45
-0
No files found.
doc/CHANGES.txt
View file @
4ee18b66
...
@@ -33,6 +33,9 @@ Zope Changes
...
@@ -33,6 +33,9 @@ Zope Changes
- Included BTreeFolder2
- Included BTreeFolder2
Bugs fixed
Bugs fixed
- Collector #1803: Fixed InitializeClass for some corner case.
- Collector #1798, issue1: ZopeTestCase no longer tries to
- Collector #1798, issue1: ZopeTestCase no longer tries to
install products that was installed by Zope during startup.
install products that was installed by Zope during startup.
...
...
lib/python/App/class_init.py
View file @
4ee18b66
...
@@ -43,8 +43,8 @@ def default__class_init__(self):
...
@@ -43,8 +43,8 @@ def default__class_init__(self):
else
:
else
:
# Supply a name implicitly so that the method can
# Supply a name implicitly so that the method can
# find the security assertions on its container.
# find the security assertions on its container.
d
[
'_implicit__name__'
]
=
1
v
.
_implicit__name__
=
1
d
[
'__name__'
]
=
name
v
.
__name__
=
name
if
name
==
'manage'
or
name
[:
7
]
==
'manage_'
:
if
name
==
'manage'
or
name
[:
7
]
==
'manage_'
:
name
=
name
+
'__roles__'
name
=
name
+
'__roles__'
if
not
have
(
name
):
if
not
have
(
name
):
...
...
lib/python/App/tests/test_class_init.py
0 → 100644
View file @
4ee18b66
##############################################################################
#
# Copyright (c) 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Tests class initialization.
"""
import
ExtensionClass
from
App.class_init
import
default__class_init__
as
InitializeClass
def
test_InitializeClass
():
"""Test that InitializeClass (default__class_init__)
works in specific corner cases.
Check when the class has an ExtensionClass as attribute.
>>> class AnotherClass(ExtensionClass.Base):
... _need__name__ = 1
>>> class C:
... foo = AnotherClass
>>> InitializeClass(C)
"""
from
zope.testing.doctest
import
DocTestSuite
import
unittest
def
test_suite
():
return
unittest
.
TestSuite
((
DocTestSuite
(),
))
if
__name__
==
'__main__'
:
unittest
.
main
()
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