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
9191a342
Commit
9191a342
authored
Jun 07, 2005
by
Florent Guillaume
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collector #1803: Fixed InitializeClass for some corner case
parent
7d57a8b1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
2 deletions
+49
-2
doc/CHANGES.txt
doc/CHANGES.txt
+2
-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 @
9191a342
...
...
@@ -26,6 +26,8 @@ Zope Changes
Bugs Fixed
- Collector #1803: Fixed InitializeClass for some corner case.
- Collector #1798, issue 1: ZopeTestCase no longer tries to
install products that was installed by Zope during startup.
...
...
lib/python/App/class_init.py
View file @
9191a342
...
...
@@ -43,8 +43,8 @@ def default__class_init__(self):
else
:
# Supply a name implicitly so that the method can
# find the security assertions on its container.
d
[
'_implicit__name__'
]
=
1
d
[
'__name__'
]
=
name
v
.
_implicit__name__
=
1
v
.
__name__
=
name
if
name
==
'manage'
or
name
[:
7
]
==
'manage_'
:
name
=
name
+
'__roles__'
if
not
have
(
name
):
...
...
lib/python/App/tests/test_class_init.py
0 → 100644
View file @
9191a342
##############################################################################
#
# 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