Commit 4bad0527 authored by Ivan Tyagov's avatar Ivan Tyagov

Test fallback search for a Web Section. Only documents in english should be returned.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21642 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f4529ec5
......@@ -430,8 +430,8 @@ class TestERP5Web(ERP5TypeTestCase, ZopeTestCase.Functional):
web_page_en.publish()
get_transaction().commit()
self.tic()
self.assertEquals(1, len(websection.getDocumentValueList()))
self.assertEquals(web_page_en, websection.getDocumentValueList()[0].getObject())
self.assertEquals(1, len(websection.getDocumentValueList(anguage='en')))
self.assertEquals(web_page_en, websection.getDocumentValueList(anguage='en')[0].getObject())
# create pages belonging to this publication_section 'documentation' but for 'bg' language
web_page_bg = portal.web_page_module.newContent(portal_type = 'Web Page',
......@@ -448,6 +448,13 @@ class TestERP5Web(ERP5TypeTestCase, ZopeTestCase.Functional):
get_transaction().commit()
self.tic()
self.assertEquals(0, len(websection.getDocumentValueList(language='bg')))
# publish page and search without a language (by default system should return 'en' docs only)
web_page_bg.publish()
get_transaction().commit()
self.tic()
self.assertEquals(1, len(websection.getDocumentValueList()))
self.assertEquals(web_page_en, websection.getDocumentValueList()[0].getObject())
def test_09_DefaultDocumentForWebSection(self, quiet=quiet, run=run_all_test):
""" Testetting default document for a Web Section. Test use case like workflow state of document.
......
......@@ -177,14 +177,6 @@ class TestGadgets(ERP5TypeTestCase):
self.assertEqual(base_websection_pad.getObject(),
current_websection_pad.getObject())
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestGadgets))
......
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