async def test_injectable_permission_resolve(self):
        """Test that permission classes with @inject are resolved correctly"""

        # Create a service to be injected
        class AuthService:
            def is_admin(self, user):
                return user.is_staff

            def is_authenticated(self, user):
                return user.is_authenticated

        # Create a permission class that uses dependency injection
        class InjectablePermission(AsyncBasePermission):
            @inject
            def __init__(self, auth_service: AuthService):
                self.auth_service = auth_service
                self.message = "Must be admin"

            async def has_permission_async(self, request, controller):
                return self.auth_service.is_admin(request.user)

        # Register service with the injector
        injector = get_injector()
        injector.binder.bind(AuthService)
        injector.binder.bind(InjectablePermission)

        # Test resolving the permission directly
        resolved_perm = InjectablePermission.resolve()

        # Create request mocks for testing
        admin_request = Mock(user=Mock(is_staff=True, is_authenticated=True))
        normal_request = Mock(user=Mock(is_staff=False, is_authenticated=True))

        # Test permission check works
        assert resolved_perm.has_permission(admin_request, None) is True
        assert resolved_perm.has_permission(normal_request, None) is False

        # Test async permission check works
        assert await resolved_perm.has_permission_async(admin_request, None) is True
        assert await resolved_perm.has_permission_async(normal_request, None) is False
Test that permission classes with @inject are resolved correctly
tests/test_async_permissions.py