[Erp5-report] r26357 - /erp5/trunk/products/ERP5/tests/testERP5Web.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Apr 8 18:12:20 CEST 2009
Author: kazuhiko
Date: Wed Apr 8 18:12:19 2009
New Revision: 26357
URL: http://svn.erp5.org?rev=26357&view=rev
Log:
a webmaster should be able to clone web sites or web sections.
Modified:
erp5/trunk/products/ERP5/tests/testERP5Web.py
Modified: erp5/trunk/products/ERP5/tests/testERP5Web.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testERP5Web.py?rev=26357&r1=26356&r2=26357&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testERP5Web.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testERP5Web.py [utf8] Wed Apr 8 18:12:19 2009
@@ -1138,7 +1138,7 @@
self.fail("An user should be able to expire a Web Section.")
def test_05_createWebSite(self, quiet=quiet, run=run_all_test):
- """ Test to create web sites with many users """
+ """ Test to create or clone web sites with many users """
if not run: return
if not quiet:
message = '\ntest_05_createWebSite'
@@ -1160,8 +1160,13 @@
except Unauthorized:
self.fail("A webmaster should be able to create a Web Site.")
+ site_2_copy = web_site_module.manage_copyObjects(ids=(site_2.getId(),))
+ site_2_clone = web_site_module[web_site_module.manage_pasteObjects(
+ site_2_copy)[0]['new_id']]
+ self.assertEquals(site_2_clone.getPortalType(), 'Web Site')
+
def test_06_createWebSection(self, quiet=quiet, run=run_all_test):
- """ Test to create web sections with many users """
+ """ Test to create or clone web sections with many users """
if not run: return
if not quiet:
message = '\ntest_06_createWebSection'
@@ -1185,6 +1190,14 @@
section_3 = section_2.newContent(portal_type='Web Section', id='section_3')
except Unauthorized:
self.fail("A webmaster should be able to create a Web Section.")
+ section_2_copy = site.manage_copyObjects(ids=(section_2.getId(),))
+ section_2_clone = site[site.manage_pasteObjects(
+ section_2_copy)[0]['new_id']]
+ self.assertEquals(section_2_clone.getPortalType(), 'Web Section')
+ section_3_copy = section_2.manage_copyObjects(ids=(section_3.getId(),))
+ section_3_clone = section_2[section_2.manage_pasteObjects(
+ section_3_copy)[0]['new_id']]
+ self.assertEquals(section_3_clone.getPortalType(), 'Web Section')
def test_suite():
suite = unittest.TestSuite()
More information about the Erp5-report
mailing list