def test_insert_single_row(self): entry = Entry("test", QDateTime.fromSecsSinceEpoch(5)) self.model.insert_row(entry) time_index = self.model.createIndex(0, 0) content_index = self.model.createIndex(0, 1) self.assertEqual(self.model.data(time_index), entry.time_string()) self.assertEqual(self.model.data(content_index), entry.content)
def test_to_time_string(self): date_time = QDateTime.fromSecsSinceEpoch(5, QTimeZone.utc()) entry = Entry("", date_time) self.assertEqual(entry.time_string(), "00:00:05")