def test_create_time_fixed(self): time_elt = odf_create_time_variable(time(19, 30), fixed=True) expected = ('<text:time text:time-value="1900-01-01T19:30:00" ' 'text:fixed="true">' '19:30:00' '</text:time>') self.assertEqual(time_elt.serialize(), expected)
def test_create_time_fixed(self): time_elt = odf_create_time_variable(time(19, 30), fixed=True) expected = ('<text:time text:time-value="1900-01-01T19:30:00" ' 'text:fixed="true">' '19:30:00' '</text:time>') self.assertEqual(time_elt.serialize(), expected)
paragraph.insert_variable(odf_create_date_variable(date(2009, 7, 20)), u"Today: ") # 10- Time # -------- heading = odf_create_heading(1, text=u'Time insertion') body.append(heading) text1 = u'A fixed time: ' text2 = u'Now: ' text3 = u'In 1 hour: ' paragraph = odf_create_paragraph(text1, style=u"Standard") body.append(paragraph) paragraph.insert_variable(odf_create_time_variable(time(19, 30), fixed=True), u"time: ") paragraph = odf_create_paragraph(text2, style=u"Standard") body.append(paragraph) paragraph.insert_variable(odf_create_time_variable(time(19, 30)), u"Now: ") paragraph = odf_create_paragraph(text3, style=u"Standard") body.append(paragraph) paragraph.insert_variable( odf_create_time_variable(time(19, 30), time_adjust=timedelta(hours=1)), u"hour: ") # 11- Chapter # -----------
u"Today: ") # 8- Time # -------- heading = odf_create_heading(1, text=u'Time insertion') body.append(heading) text1 = u'A fixed time: ' text2 = u'Now: ' text3 = u'In 1 hour: ' paragraph = odf_create_paragraph(text1, style=u"Standard") body.append(paragraph) paragraph.insert_variable(odf_create_time_variable(time(19, 30), fixed=True), u"time: ") paragraph = odf_create_paragraph(text2, style=u"Standard") body.append(paragraph) paragraph.insert_variable(odf_create_time_variable(time(19, 30)), u"Now: ") paragraph = odf_create_paragraph(text3, style=u"Standard") body.append(paragraph) paragraph.insert_variable(odf_create_time_variable(time(19, 30), time_adjust=timedelta(hours=1)), u"hour: ") # 9- Chapter # -----------
def test_create_time_text(self): time_elt = odf_create_time_variable(time(19, 30), text=u'19h30') expected = ('<text:time text:time-value="1900-01-01T19:30:00">' '19h30' '</text:time>') self.assertEqual(time_elt.serialize(), expected)
def test_create_time_text(self): time_elt = odf_create_time_variable(time(19, 30), text='19h30') expected = ('<text:time text:time-value="1900-01-01T19:30:00">' '19h30' '</text:time>') self.assertEqual(time_elt.serialize(), expected)