changeset 226:b7018ec56ee5

Always use the bare JID for affilitations. Author: sir_sigurd, ralphm. Fixes: #20.
author Ralph Meijer <ralphm@ik.nu>
date Sun, 13 Feb 2011 21:46:33 +0100
parents c15c2fc058ed
children 8540825f85e0
files idavoll/memory_storage.py idavoll/test/test_storage.py
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/idavoll/memory_storage.py	Sun Feb 13 21:34:18 2011 +0100
+++ b/idavoll/memory_storage.py	Sun Feb 13 21:46:33 2011 +0100
@@ -126,7 +126,7 @@
 
 
     def getAffiliation(self, entity):
-        return defer.succeed(self._affiliations.get(entity.full()))
+        return defer.succeed(self._affiliations.get(entity.userhost()))
 
 
     def getSubscription(self, subscriber):
--- a/idavoll/test/test_storage.py	Sun Feb 13 21:34:18 2011 +0100
+++ b/idavoll/test/test_storage.py	Sun Feb 13 21:46:33 2011 +0100
@@ -13,7 +13,7 @@
 
 from idavoll import error, iidavoll
 
-OWNER = jid.JID('owner@example.com')
+OWNER = jid.JID('owner@example.com/Work')
 SUBSCRIBER = jid.JID('subscriber@example.com/Home')
 SUBSCRIBER_NEW = jid.JID('new@example.com/Home')
 SUBSCRIBER_TO_BE_DELETED = jid.JID('to_be_deleted@example.com/Home')
@@ -421,7 +421,7 @@
 
         def cb2(affiliations):
             affiliations = dict(((a[0].full(), a[1]) for a in affiliations))
-            self.assertEquals(affiliations[OWNER.full()], 'owner')
+            self.assertEquals(affiliations[OWNER.userhost()], 'owner')
 
         d = self.s.getNode('pre-existing')
         d.addCallback(cb1)