[CalendarServer-changes] [14200] CalendarServer/trunk/txdav/who

source_changes at macosforge.org source_changes at macosforge.org
Fri Dec 5 12:50:56 PST 2014


Revision: 14200
          http://trac.calendarserver.org//changeset/14200
Author:   sagen at apple.com
Date:     2014-12-05 12:50:55 -0800 (Fri, 05 Dec 2014)
Log Message:
-----------
For the synthesized record returned from delegates recordWithShortName( ), use the original shortName passed in

Modified Paths:
--------------
    CalendarServer/trunk/txdav/who/delegates.py
    CalendarServer/trunk/txdav/who/test/test_delegates.py

Modified: CalendarServer/trunk/txdav/who/delegates.py
===================================================================
--- CalendarServer/trunk/txdav/who/delegates.py	2014-12-04 21:34:26 UTC (rev 14199)
+++ CalendarServer/trunk/txdav/who/delegates.py	2014-12-05 20:50:55 UTC (rev 14200)
@@ -183,7 +183,7 @@
         record = DirectoryRecord(self, {
             FieldName.uid: uid,
             FieldName.recordType: recordType,
-            FieldName.shortNames: (uid,),
+            FieldName.shortNames: (shortName,),
         })
         return succeed(record)
 

Modified: CalendarServer/trunk/txdav/who/test/test_delegates.py
===================================================================
--- CalendarServer/trunk/txdav/who/test/test_delegates.py	2014-12-04 21:34:26 UTC (rev 14199)
+++ CalendarServer/trunk/txdav/who/test/test_delegates.py	2014-12-05 20:50:55 UTC (rev 14200)
@@ -36,6 +36,19 @@
 
 
     @inlineCallbacks
+    def test_recordCreation(self):
+        """
+        Verify the record we get back from recordWithShortName has a shortName
+        that matches the one we looked up.
+        """
+        record = yield self.directory.recordWithShortName(
+            DelegateRecordType.readDelegateGroup,
+            "foo"
+        )
+        self.assertEquals(record.shortNames[0], "foo")
+
+
+    @inlineCallbacks
     def test_directDelegation(self):
         txn = self.store.newTransaction(label="test_directDelegation")
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20141205/8e3ca989/attachment.html>


More information about the calendarserver-changes mailing list