def test_remove_permissions(self):
        """Test that users can have their permissions removed"""

        checker = PermissionsChecker()
        self.injector.inject(self.tourn_1)
        player = '{}_player_1'.format(self.tourn_1)
        tourn_prot_obj = Tournament(self.tourn_1).get_dao().protected_object

        checker.add_permission(player, 'modify_application', tourn_prot_obj)
        prot_objs = ProtectedObject.query.count()
        prot_obj_actions = ProtObjAction.query.count()
        prot_obj_perms = ProtObjPerm.query.count()
        acc_perms = AccountProtectedObjectPerm.query.count()

        checker.remove_permission(player, 'modify_application', tourn_prot_obj)

        compare(prot_objs, ProtectedObject.query.count())
        compare(prot_obj_actions, ProtObjAction.query.count())
        compare(prot_obj_perms, ProtObjPerm.query.count())
        # the one account should now have lost it's permissions
        compare(acc_perms - 1, AccountProtectedObjectPerm.query.count())