Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
142
Merge Requests
142
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
8646b266
Commit
8646b266
authored
May 30, 2011
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for multiple forum existence in same ERP5 Web Site.
parent
ac585802
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
product/ERP5/tests/testERP5Discussion.py
product/ERP5/tests/testERP5Discussion.py
+40
-0
No files found.
product/ERP5/tests/testERP5Discussion.py
View file @
8646b266
...
...
@@ -98,6 +98,46 @@ class TestERP5Discussion(ERP5TypeTestCase):
post
=
self
.
stepCreatePost
(
thread
);
self
.
stepTic
()
def
test_MultipleForum
(
self
):
"""
Test multiple forums may exists within same ERP5 Web Site.
"""
portal
=
self
.
portal
# create web sections & set predicates
group1
=
portal
.
portal_categories
.
group
.
newContent
(
portal_type
=
'Category'
,
title
=
'Group 1'
)
group2
=
portal
.
portal_categories
.
group
.
newContent
(
portal_type
=
'Category'
,
title
=
'Group 2'
)
web_site
=
portal
.
web_site_module
.
newContent
(
portal_type
=
'Web Site'
)
web_section1
=
web_site
.
newContent
(
portal_type
=
'Web Section'
)
web_section2
=
web_site
.
newContent
(
portal_type
=
'Web Section'
)
web_section1
.
setMultimembershipCriterionBaseCategoryList
([
'group'
])
web_section1
.
setMembershipCriterionCategoryList
([
group1
.
getRelativeUrl
()])
web_section2
.
setMultimembershipCriterionBaseCategoryList
([
'group'
])
web_section2
.
setMembershipCriterionCategoryList
([
group2
.
getRelativeUrl
()])
self
.
stepTic
()
# add threads on Web Section context
web_section1
.
WebSection_createNewDiscussionThread
(
'test1'
,
'test1 body'
)
web_section2
.
WebSection_createNewDiscussionThread
(
'test2'
,
'test2 body'
)
self
.
stepTic
()
discussion_thread_object1
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Discussion Thread'
,
title
=
'test1'
)
discussion_thread_object2
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Discussion Thread'
,
title
=
'test2'
)
self
.
assertEqual
(
group1
,
discussion_thread_object1
.
getGroupValue
())
self
.
assertEqual
(
group2
,
discussion_thread_object2
.
getGroupValue
())
# check getDocumentValue.. on Web Section context
self
.
assertSameSet
([],
web_section1
.
getDocumentValueList
())
self
.
assertSameSet
([],
web_section2
.
getDocumentValueList
())
discussion_thread_object1
.
publish
()
discussion_thread_object2
.
publish
()
self
.
stepTic
()
self
.
assertSameSet
([
discussion_thread_object1
],
[
x
.
getObject
()
for
x
in
web_section1
.
getDocumentValueList
()])
self
.
assertSameSet
([
discussion_thread_object2
],
[
x
.
getObject
()
for
x
in
web_section2
.
getDocumentValueList
()])
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestERP5Discussion
))
...
...
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