[CalendarServer-changes] [8435] CalendarServer/trunk/txdav/caldav/datastore
source_changes at macosforge.org
source_changes at macosforge.org
Tue Dec 13 12:27:10 PST 2011
Revision: 8435
http://trac.macosforge.org/projects/calendarserver/changeset/8435
Author: cdaboo at apple.com
Date: 2011-12-13 12:27:10 -0800 (Tue, 13 Dec 2011)
Log Message:
-----------
Make sure dead properties are copied over when splitting calendars.
Modified Paths:
--------------
CalendarServer/trunk/txdav/caldav/datastore/sql.py
CalendarServer/trunk/txdav/caldav/datastore/test/test_sql.py
Modified: CalendarServer/trunk/txdav/caldav/datastore/sql.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/sql.py 2011-12-13 20:26:11 UTC (rev 8434)
+++ CalendarServer/trunk/txdav/caldav/datastore/sql.py 2011-12-13 20:27:10 UTC (rev 8435)
@@ -510,7 +510,7 @@
yield newcalendar.setSupportedComponents(component.upper())
# Transfer properties over
- yield self._properties.copyAllProperties(newcalendar._properties)
+ yield newcalendar._properties.copyAllProperties(self._properties)
# Transfer sharing
yield self._transferSharingDetails(newcalendar, component)
Modified: CalendarServer/trunk/txdav/caldav/datastore/test/test_sql.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/test/test_sql.py 2011-12-13 20:26:11 UTC (rev 8434)
+++ CalendarServer/trunk/txdav/caldav/datastore/test/test_sql.py 2011-12-13 20:27:10 UTC (rev 8435)
@@ -40,6 +40,7 @@
from txdav.common.datastore.test.util import buildStore, populateCalendarsFrom
from twistedcaldav import caldavxml
+from twistedcaldav.caldavxml import CalendarDescription
from twistedcaldav.config import config
from twistedcaldav.dateops import datetimeMktime
from twistedcaldav.query import calendarqueryfilter
@@ -839,6 +840,13 @@
sync information is updated.
"""
+ # calendar_2 add a dead property to make sure it gets copied over
+ home = yield self.transactionUnderTest().calendarHomeWithUID("home_splits")
+ calendar2 = yield home.calendarWithName("calendar_2")
+ pkey = PropertyName.fromElement(CalendarDescription)
+ calendar2.properties()[pkey] = CalendarDescription.fromString("A birthday calendar")
+ yield self.commit()
+
# calendar_1 no change
home = yield self.transactionUnderTest().calendarHomeWithUID("home_splits")
calendar1 = yield home.calendarWithName("calendar_1")
@@ -879,6 +887,8 @@
self.assertEqual(len(deleted), 0)
result = yield calendar2_vtodo.getSupportedComponents()
self.assertEquals(result, "VTODO")
+ self.assertTrue(pkey in calendar2_vtodo.properties())
+ self.assertEqual(str(calendar2_vtodo.properties()[pkey]), "A birthday calendar")
calendar2 = yield home.calendarWithName("calendar_2")
children = yield calendar2.listCalendarObjects()
@@ -890,6 +900,8 @@
self.assertEqual(sorted(deleted), ["3.ics", "5.ics"])
result = yield calendar2.getSupportedComponents()
self.assertEquals(result, "VEVENT")
+ self.assertTrue(pkey in calendar2.properties())
+ self.assertEqual(str(calendar2.properties()[pkey]), "A birthday calendar")
@inlineCallbacks
def test_noSplitCalendars(self):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20111213/a8ab8f1e/attachment-0001.html>
More information about the calendarserver-changes
mailing list