Ejemplo n.º 1
0
    def test_same_date(self):
        start = DateTime(2013, 01, 01, 18, 00)
        end = DateTime(2013, 01, 01, 19, 00)
        wholeday = False

        self.assertEquals(format_date(start, end, wholeday),
            '01.01.2013 18:00 - 19:00')
Ejemplo n.º 2
0
    def test_diff_date_wholeday(self):
        start = DateTime(2013, 01, 01)
        end = DateTime(2013, 01, 03)
        wholeday = True

        self.assertEquals(format_date(start, end, wholeday),
            '01.01.2013 - 03.01.2013')
 def test_creation(self):
     self.browser.addHeader('Authorization', 'Basic %s:%s' % (
             TEST_USER_NAME, TEST_USER_PASSWORD, ))
     self.browser.open("%s/createObject?type_name=EventPage" %
         self.eventfolder.absolute_url())
     self.browser.getControl(name='title').value = 'A Title'
     self.browser.getControl(name='endDate_minute').value = ['20']
     self.browser.getControl(name='endDate_hour').value = ['08']
     self.browser.getControl(name='endDate_day').value = ['20']
     self.browser.getControl(name='endDate_month').value = ['05']
     self.browser.getControl(name='endDate_year').value = ['2013']
     self.browser.getControl(name='startDate_minute').value = ['20']
     self.browser.getControl(name='startDate_hour').value = ['07']
     self.browser.getControl(name='startDate_day').value = ['20']
     self.browser.getControl(name='startDate_month').value = ['05']
     self.browser.getControl(name='startDate_year').value = ['2013']
     self.browser.getControl(name='location').value = 'D\xc3\xbcbendorf'
     self.browser.getControl(name='form.button.save').click()
     self.assertEqual(self.browser.url,
         'http://nohost/plone/eventfolder/a-title/')
     event = self.eventfolder.get('a-title')
     self.assertEqual(event.location.encode('utf-8'), 'D\xc3\xbcbendorf')
     self.assertEqual(
         format_date(event.start(), event.end(), event.getWholeDay()),
         '20.05.2013 07:20 - 08:20')
Ejemplo n.º 4
0
 def get_date(self):
     return format_date(self.context.start(), self.context.end(), self.context.getWholeDay())