# Path: modernrpc/exceptions.py
# RPC_INTERNAL_ERROR = -32603


import pytest
from modernrpc.exceptions import RPC_INTERNAL_ERROR
            ("in_group_a_and_b_required", [5]),
            ("in_group_a_and_b_required_alt", [5]),
            ("in_group_a_or_b_required", [5]),
        ],
    )
    def test_with_anonymous_user(self, any_rpc_client, method_name, args):
        # Exception test match
        exc_match = r'Authentication failed when calling "{func}"'.format(
            func=method_name
        )
        with pytest.raises(
            any_rpc_client.auth_error_exception, match=exc_match
        ) as exc_info:
            any_rpc_client.call(method_name, *args)
        any_rpc_client.assert_exception_code(exc_info.value, RPC_INTERNAL_ERROR)

    def test_jsonrpc_batch_request(self, jsonrpc_client):
        result = jsonrpc_client.batch_request(
            [
                ("add", [7, 3]),
                ("logged_superuser_required", [6]),
            ]
        )
        assert isinstance(result, jsonrpc_client.batch_result_klass)
        assert result == [
            {"id": 0, "jsonrpc": "2.0", "result": 10},
            {
                "id": 1,
                "jsonrpc": "2.0",
                "error": {

# Path: modernrpc/exceptions.py
# RPC_INTERNAL_ERROR = -32603


# Path: tests/functional/test_authentication.py
import pytest
from modernrpc.exceptions import RPC_INTERNAL_ERROR

            ("in_group_a_and_b_required", [5]),
            ("in_group_a_and_b_required_alt", [5]),
            ("in_group_a_or_b_required", [5]),
        ],
    )
    def test_with_anonymous_user(self, any_rpc_client, method_name, args):
        # Exception test match
        exc_match = r'Authentication failed when calling "{func}"'.format(
            func=method_name
        )
        with pytest.raises(
            any_rpc_client.auth_error_exception, match=exc_match
        ) as exc_info:
            any_rpc_client.call(method_name, *args)
        any_rpc_client.assert_exception_code(exc_info.value, RPC_INTERNAL_ERROR)

    def test_jsonrpc_batch_request(self, jsonrpc_client):
        result = jsonrpc_client.batch_request(
            [
                ("add", [7, 3]),
                ("logged_superuser_required", [6]),
            ]
        )
        assert isinstance(result, jsonrpc_client.batch_result_klass)
        assert result == [
            {"id": 0, "jsonrpc": "2.0", "result": 10},
            {
                "id": 1,
                "jsonrpc": "2.0",
                "error": {

                    "code": RPC_INTERNAL_ERROR,