예제 #1
0
 def _after_import_tests(self):
     item = get_item_for_uuid(self.event_uuid)
     work_collection = get_item_for_uuid(self.work_collection_uuid)
     self.assertEqual(len(work_collection.items), 3)
     self._find_sidebar_entry(work_collection)
     self.assertEqual(tuple(item.collections), (work_collection,) )
     self.assertNotEqual(item, None)
     self.assertEqual(item.title, 'Office supplies order')
     self.assert_(Event.installed_on(item))
     self.assertEqual(Event(item).start, self.jan_ninth)
     self.assert_(Event(item).any_time)
     self.failIf(Event(item).all_day)
예제 #2
0
 def test_old_chex_import(self):
     """Success when importing old style chex files."""
     self.assertEqual(len(_items_by_uuid), 0)
     reload(self._load('chex_chandler1.gz'), gzip=True)
     self.assertEqual(len(_items_by_uuid), 49)
     self._after_import_tests()
     entry = self._find_sidebar_entry(get_item_for_uuid(self.work_collection_uuid))
     self.assertEqual(entry.hsv_color[0], 210.0)
예제 #3
0
 def delete_event(self, record):
     uuid, recurrence_id = splitUUID(record.uuid)
     item = eim.get_item_for_uuid(uuid)
     if item is not None and item.isLive() and pim.has_stamp(item,
         EventStamp):
         if recurrence_id:
             occurrence = EventStamp(item).getRecurrenceID(recurrence_id)
             occurrence.unmodify(partial=True)
         else:
             EventStamp(item).remove()
예제 #4
0
 def delete_event(self, record):
     uuid, recurrence_id = splitUUID(record.uuid)
     item = eim.get_item_for_uuid(uuid)
     if item is not None and item.isLive() and pim.has_stamp(
             item, EventStamp):
         if recurrence_id:
             occurrence = EventStamp(item).getRecurrenceID(recurrence_id)
             occurrence.unmodify(partial=True)
         else:
             EventStamp(item).remove()