@@ -0,0 +1,97 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from decimal import Decimal
|
||||
|
||||
import pytest
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
from apps.profiles.models import SearchProfile
|
||||
from apps.sources.models import Source
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def user(db):
|
||||
return get_user_model().objects.create_user(
|
||||
username="jens",
|
||||
email="jens@example.invalid",
|
||||
password="correct-horse-battery-staple",
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def profile(user):
|
||||
return SearchProfile.objects.create(
|
||||
user=user,
|
||||
name="Testprofiel",
|
||||
is_active=True,
|
||||
home_municipality="Hasselt",
|
||||
home_latitude=Decimal("50.930700"),
|
||||
home_longitude=Decimal("5.332500"),
|
||||
max_distance_km=50,
|
||||
learning_enabled=True,
|
||||
desired_titles=["infrastructure engineer", "systeembeheerder"],
|
||||
excluded_titles=["sales", "recruiter"],
|
||||
desired_skills=["Microsoft 365", "VMware"],
|
||||
allowed_employment_types=["full_time", "permanent"],
|
||||
preferred_workplace=["hybrid", "on_site"],
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def source(db):
|
||||
return Source.objects.create(
|
||||
name="Example jobs",
|
||||
source_type=Source.Type.EMPLOYER,
|
||||
base_url="https://jobs.example.org/vacatures/",
|
||||
domain="jobs.example.org",
|
||||
status=Source.Status.ACTIVE,
|
||||
policy=Source.Policy.ALLOW,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def employer(db):
|
||||
from apps.jobs.models import Employer
|
||||
|
||||
return Employer.objects.create(
|
||||
name="Example IT",
|
||||
normalized_name="example it",
|
||||
domain="jobs.example.org",
|
||||
is_direct_employer=True,
|
||||
is_recruiter=False,
|
||||
confidence=0.9,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def job(db, employer):
|
||||
from apps.jobs.models import JobPosting
|
||||
|
||||
return JobPosting.objects.create(
|
||||
employer=employer,
|
||||
original_title="Infrastructure Engineer",
|
||||
normalized_title="infrastructure engineer",
|
||||
job_family="infrastructure",
|
||||
canonical_url="https://jobs.example.org/vacatures/infrastructure-engineer",
|
||||
canonical_key="c" * 64,
|
||||
content_hash="d" * 64,
|
||||
description_text=(
|
||||
"Beheer Microsoft 365 en VMware. Hybride werk met beperkte tweedelijnssupport."
|
||||
),
|
||||
raw_location="Hasselt, Limburg",
|
||||
region="Limburg",
|
||||
municipality="Hasselt",
|
||||
workplace_type=JobPosting.Workplace.HYBRID,
|
||||
employment_types=["full_time", "permanent"],
|
||||
skills_required=["Microsoft 365"],
|
||||
skills_preferred=["VMware"],
|
||||
direct_employer=True,
|
||||
recruiter=False,
|
||||
extraction_confidence=0.9,
|
||||
analysis_features={
|
||||
"support_ratio": 0.1,
|
||||
"public_sector_signal": 0.0,
|
||||
"experience_years_max": 3,
|
||||
},
|
||||
status=JobPosting.Status.ACTIVE,
|
||||
)
|
||||
Reference in New Issue
Block a user