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
f765bbe5
Commit
f765bbe5
authored
Oct 12, 2001
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Repair tests, adding dummy user for _setObject's sake.
parent
e46e090f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
lib/python/Products/ZCatalog/tests/testCatalog.py
lib/python/Products/ZCatalog/tests/testCatalog.py
+14
-1
No files found.
lib/python/Products/ZCatalog/tests/testCatalog.py
View file @
f765bbe5
...
@@ -24,6 +24,17 @@ import whrandom,string, unittest
...
@@ -24,6 +24,17 @@ import whrandom,string, unittest
# Stuff of Chris
# Stuff of Chris
################################################################################
################################################################################
from
AccessControl.SecurityManagement
import
newSecurityManager
from
AccessControl.SecurityManagement
import
noSecurityManager
class
DummyUser
:
def
__init__
(
self
,
name
):
self
.
_name
=
name
def
getUserName
(
self
):
return
self
.
_name
class
CatalogBase
:
class
CatalogBase
:
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -34,7 +45,7 @@ class CatalogBase:
...
@@ -34,7 +45,7 @@ class CatalogBase:
def
tearDown
(
self
):
def
tearDown
(
self
):
self
.
_vocabulary
=
self
.
_catalog
=
None
self
.
_vocabulary
=
self
.
_catalog
=
None
class
TestAddDelColumn
(
unittest
.
TestCase
,
CatalogB
ase
):
class
TestAddDelColumn
(
CatalogBase
,
unittest
.
TestC
ase
):
def
testAdd
(
self
):
def
testAdd
(
self
):
self
.
_catalog
.
addColumn
(
'id'
)
self
.
_catalog
.
addColumn
(
'id'
)
assert
self
.
_catalog
.
schema
.
has_key
(
'id'
)
==
1
,
'add column failed'
assert
self
.
_catalog
.
schema
.
has_key
(
'id'
)
==
1
,
'add column failed'
...
@@ -101,7 +112,9 @@ class TestZCatalogObject(unittest.TestCase):
...
@@ -101,7 +112,9 @@ class TestZCatalogObject(unittest.TestCase):
def
testInstantiateWithoutVocab
(
self
):
def
testInstantiateWithoutVocab
(
self
):
v
=
Vocabulary
.
Vocabulary
(
'Vocabulary'
,
'Vocabulary'
,
globbing
=
1
)
v
=
Vocabulary
.
Vocabulary
(
'Vocabulary'
,
'Vocabulary'
,
globbing
=
1
)
newSecurityManager
(
None
,
DummyUser
(
'phred'
)
)
zc
=
ZCatalog
.
ZCatalog
(
'acatalog'
)
zc
=
ZCatalog
.
ZCatalog
(
'acatalog'
)
noSecurityManager
()
assert
hasattr
(
zc
,
'Vocabulary'
)
assert
hasattr
(
zc
,
'Vocabulary'
)
assert
zc
.
getVocabulary
().
__class__
==
v
.
__class__
assert
zc
.
getVocabulary
().
__class__
==
v
.
__class__
...
...
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