# HG changeset patch # User Ralph Meijer # Date 1297629993 -3600 # Node ID b7018ec56ee55aca9c13796a874a049a7fe6a602 # Parent c15c2fc058ed3b155b0f045dd628aa734373f381 Always use the bare JID for affilitations. Author: sir_sigurd, ralphm. Fixes: #20. diff -r c15c2fc058ed -r b7018ec56ee5 idavoll/memory_storage.py --- 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): diff -r c15c2fc058ed -r b7018ec56ee5 idavoll/test/test_storage.py --- 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)