Commit 1e55357b authored by Ivan Tyagov's avatar Ivan Tyagov

Add testing for showing not yet indexed threads using a relative url passed from REQUEST.

parent 6f583217
......@@ -106,6 +106,35 @@ class TestERP5Discussion(ERP5TypeTestCase):
# indexed already
self.assertSameSet([post], thread.DiscussionThread_getDiscussionPostList())
def test_03_createDiscussionThread(self):
"""
Create a disucssion thread
"""
portal = self.portal
# create web sections & set predicates
group1 = portal.portal_categories.group.newContent(portal_type='Category',
title = 'Group 1')
web_site = portal.web_site_module.newContent(portal_type='Web Site')
web_section1 = web_site.newContent(portal_type='Web Section')
web_section1.setMultimembershipCriterionBaseCategoryList(['group'])
web_section1.setMembershipCriterionCategoryList([group1.getRelativeUrl()])
self.tic()
web_section1.WebSection_createNewDiscussionThread('test1-new', 'test1 body')
discussion_thread = [x for x in self.portal.discussion_thread_module.objectValues() \
if x.getReference()=='test1-new'][0]
# not indexed yet
self.assertSameSet([], web_section1.WebSection_getDiscussionThreadList())
# not indexed but its relative url is passed through REQUEST
self.app.REQUEST.set('thread_relative_url', discussion_thread.getRelativeUrl())
self.assertSameSet([discussion_thread], web_section1.WebSection_getDiscussionThreadList())
self.tic()
# indexed already
self.assertSameSet([discussion_thread], web_section1.WebSection_getDiscussionThreadList())
def test_MultipleForum(self):
"""
Test multiple forums may exists within same ERP5 Web Site.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment