import pytest from django.contrib.auth import get_user_model from label_studio_sdk import LabelStudio from organizations.tests.factories import OrganizationFactory from projects.tests.factories import ProjectFactory from tasks.tests.factories import TaskFactory from users.tests.factories import UserFactory User = get_user_model() class TestSDKPredictionValidation: """Comprehensive tests for prediction validation using Label Studio SDK""" @pytest.fixture(autouse=True) def setup(self, django_db_setup, django_db_blocker): """Set up test environment with user, organization, project, and task using factories""" with django_db_blocker.unblock(): self.user = UserFactory() self.organization = OrganizationFactory(created_by=self.user) self.user.active_organization = self.organization self.user.save() # Create a project with a comprehensive label configuration self.project = ProjectFactory( title='Test Project', label_config="""