async def test_permissions_with_different_http_methods(self):
        """Test IsAuthenticatedOrReadOnly permission with different HTTP methods"""

        # Create a new controller to test IsAuthenticatedOrReadOnly
        @api_controller("read-only")
        class ReadOnlyController(ControllerBase):
            @http_get(
                "resource/", permissions=[permissions.IsAuthenticatedOrReadOnly()]
            )
            async def get_resource(self):
                return {"success": True}

            @http_post(
                "resource/", permissions=[permissions.IsAuthenticatedOrReadOnly()]
            )
            async def post_resource(self):
                return {"success": True}

        # Initialize the async test client with the controller class
        client = TestAsyncClient(ReadOnlyController)

        # Create authenticated and anonymous users
        auth_user = Mock(is_authenticated=True)
        anon_user = AnonymousUser()

        # Anonymous user with GET (read) should be allowed
        response = await client.get("/resource/", user=anon_user)
        assert response.status_code == 200

        # Anonymous user with POST (write) should be rejected
        response = await client.post("/resource/", user=anon_user)
        assert response.status_code == 403

        # Authenticated user should be allowed for GET
        response = await client.get("/resource/", user=auth_user)
        assert response.status_code == 200

        # Authenticated user should be allowed for POST
        response = await client.post("/resource/", user=auth_user)
        assert response.status_code == 200
Test IsAuthenticatedOrReadOnly permission with different HTTP methods
tests/test_async_permissions.py