From eb8d6ecc2626ee1590748c36e6a15e644a336d0a Mon Sep 17 00:00:00 2001 From: Gabriel Monnerat <gabriel@tiolive.com> Date: Mon, 28 Feb 2011 21:23:00 +0000 Subject: [PATCH] - add test to UNG Calendar - add docstrings git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43830 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../TestTemplateItem/testUNG.py | 31 +++++++++++++++++-- bt5/erp5_web_ung_theme/bt/revision | 2 +- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/bt5/erp5_web_ung_theme/TestTemplateItem/testUNG.py b/bt5/erp5_web_ung_theme/TestTemplateItem/testUNG.py index 9f3388a205..f6c0ce8400 100644 --- a/bt5/erp5_web_ung_theme/TestTemplateItem/testUNG.py +++ b/bt5/erp5_web_ung_theme/TestTemplateItem/testUNG.py @@ -146,7 +146,7 @@ class TestUNG(ERP5TypeTestCase): self.assertEquals(len(self.portal.portal_catalog(relative_url=relative_url)), 0) def testWebSection_userFollowUpWebPage(self): - """ """ + """Test if user is added in field Follow Up of Web Page""" web_page = self.portal.web_page_module.newContent(portal_type="Web Page") web_page.setReference("new.Web-Page") self.stepTic() @@ -173,11 +173,36 @@ class TestUNG(ERP5TypeTestCase): sorted(followup_list)) def testWebSection_getGadgetPathList(self): - """ """ + """Validate the gadget list""" gadget_list = eval(self.portal.WebSection_getGadgetPathList()) for gadget in gadget_list: url = gadget.get("image_url").split("?")[0] url = url.replace("/default_image", "") catalog_result = self.portal.portal_catalog(relative_url=url) self.assertEquals(len(catalog_result), 1) - self.assertEquals(catalog_result[0].getTitle(), gadget.get('title')) \ No newline at end of file + self.assertEquals(catalog_result[0].getTitle(), gadget.get('title')) + + def testEventModule_createNewEvent(self): + """ """ + portal = self.portal + event_dict = dict(portal_type="Note", + title="Buy Phone", + event_text_content="testUNG Sample", + start_date_hour=11, + start_date_minute=12, + start_date_day=12, + start_date_month=02, + start_date_year=2011, + stop_date_hour=12, + stop_date_minute=12, + stop_date_day=13, + stop_date_month=02, + stop_date_year=2011) + portal.REQUEST.form.update(event_dict) + portal.event_module.EventModule_createNewEvent() + self.stepTic() + event = portal.portal_catalog.getResultValue(portal_type="Note") + self.assertEquals(event.getDescription(), "testUNG Sample") + start_date = event.getStartDate() + self.assertEquals(start_date.month(), 2) + self.assertEquals(start_date.minute(), 12) \ No newline at end of file diff --git a/bt5/erp5_web_ung_theme/bt/revision b/bt5/erp5_web_ung_theme/bt/revision index b8e817d4f8..ae4d10b425 100644 --- a/bt5/erp5_web_ung_theme/bt/revision +++ b/bt5/erp5_web_ung_theme/bt/revision @@ -1 +1 @@ -255 \ No newline at end of file +256 \ No newline at end of file -- 2.30.9