[CalendarServer-changes] [9736] CalendarServer/trunk/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Tue Aug 21 13:57:12 PDT 2012


Revision: 9736
          http://trac.macosforge.org/projects/calendarserver/changeset/9736
Author:   sagen at apple.com
Date:     2012-08-21 13:57:11 -0700 (Tue, 21 Aug 2012)
Log Message:
-----------
Adds getctag to notification collections

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/resource.py
    CalendarServer/trunk/twistedcaldav/test/test_resource.py

Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py	2012-08-21 19:02:38 UTC (rev 9735)
+++ CalendarServer/trunk/twistedcaldav/resource.py	2012-08-21 20:57:11 UTC (rev 9736)
@@ -430,6 +430,11 @@
                     carddavxml.MaxResourceSize.qname(),
                 )
 
+        if self.isNotificationCollection():
+            baseProperties += (
+                customxml.GETCTag.qname(),
+            )
+
         if hasattr(self, "scheduleTag") and self.scheduleTag:
             baseProperties += (
                 caldavxml.ScheduleTag.qname(),
@@ -608,7 +613,9 @@
             returnValue(element.ResourceID(element.HRef.fromString(self.resourceID())))
 
         elif qname == customxml.GETCTag.qname() and (
-            self.isPseudoCalendarCollection() or self.isAddressBookCollection()
+            self.isPseudoCalendarCollection() or
+            self.isAddressBookCollection() or
+            self.isNotificationCollection()
         ):
             returnValue(customxml.GETCTag.fromString((yield self.getInternalSyncToken())))
 

Modified: CalendarServer/trunk/twistedcaldav/test/test_resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_resource.py	2012-08-21 19:02:38 UTC (rev 9735)
+++ CalendarServer/trunk/twistedcaldav/test/test_resource.py	2012-08-21 20:57:11 UTC (rev 9736)
@@ -26,6 +26,7 @@
  CalendarHomeResource, AddressBookHomeResource
 from twistedcaldav.test.util import InMemoryPropertyStore
 from twistedcaldav.test.util import TestCase
+from twistedcaldav.notifications import NotificationCollectionResource
 
 
 class StubProperty(object):
@@ -85,7 +86,11 @@
         self.assertTrue(('http://calendarserver.org/ns/', 'xmpp-heartbeat-uri') not in resource.liveProperties())
         self.assertTrue(('http://calendarserver.org/ns/', 'xmpp-server') not in resource.liveProperties())
 
+    def test_notificationCollectionLiveProperties(self):
+        resource = NotificationCollectionResource()
+        self.assertTrue(('http://calendarserver.org/ns/', 'getctag') in resource.liveProperties())
 
+
     @inlineCallbacks
     def test_push404(self):
         """
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120821/c6ce4c60/attachment.html>


More information about the calendarserver-changes mailing list