def test_join_normally(self): XUser.join(self.http_req, self.username, self.group_name) user = User.objects.get(username=self.username) user_added_to_group = user.groups.filter(name=self.group_name).exists() self.assertTrue(user_added_to_group, 'User should be added to group.')
def test_join_nonexistent_group(self): try: XUser.join(self.http_req, self.username, 'nonexistent group name') except Fault as e: self.assertEqual(e.faultCode, 404)
def test_join_nonexistent_user(self): try: XUser.join(self.http_req, 'nonexistent user', 'whatever group name') except Fault as e: self.assertEqual(e.faultCode, 404)