def METHOD_NAME(self, organizations, memberships, users, org_role, invitee_role):
    org_id = self.org_id
    inviter_user = self.get_member(org_role, memberships, org_id)
    invitee_user = self.get_non_member_users(memberships, users)[0]
    if org_role in ["worker", "supervisor"]:
        self._test_post_invitation_403(
            inviter_user["username"],
            {"role": invitee_role, "email": invitee_user["email"]},
            org_id=org_id,
        )
    elif invitee_role in ["worker", "supervisor"]:
        self._test_post_invitation_201(
            inviter_user["username"],
            {"role": invitee_role, "email": invitee_user["email"]},
            invitee_user,
            org_id=org_id,
        )
    elif invitee_role == "maintainer":
        if org_role == "owner":
            # only the owner can invite a maintainer
            self._test_post_invitation_201(
                inviter_user["username"],
                {"role": invitee_role, "email": invitee_user["email"]},
                invitee_user,
                org_id=org_id,
            )
        else:
            self._test_post_invitation_403(
                inviter_user["username"],
                {"role": invitee_role, "email": invitee_user["email"]},
                org_id=org_id,
            )
    elif invitee_role == "owner":
        # nobody can invite an owner
        self._test_post_invitation_403(
            inviter_user["username"],
            {"role": invitee_role, "email": invitee_user["email"]},
            org_id=org_id,
        )
    else:
        assert False, "Unknown role"