def testGroupMembership(self):
     group = self.portal.testgroup
     member = group.testuser  # We need acquisition to be correct
     mem_auth = IMembraneUserAuth(member)
     mem_grps = IMembraneUserGroups(member)
     member2 = self.member2
     mem2_auth = IMembraneUserAuth(member2)
     mem2_grps = IMembraneUserGroups(member2)
     self.failUnlessEqual(group.getGroupMembers(),
                          (mem_auth.getUserId(),))
     self.failUnlessEqual(mem_grps.getGroupsForPrincipal(mem_grps),
                          (group.getId(),))
     self.group.setMembers([member2.UID()])
     self.failUnlessEqual(sortTuple(group.getGroupMembers()),
                          sortTuple([mem2_auth.getUserId(),
                                     mem_auth.getUserId()]))
     self.failUnlessEqual(
         mem2_grps.getGroupsForPrincipal(mem2_grps), (group.getId(),))