feat: replace pipeline profile and source health

This commit is contained in:
Jens
2026-07-22 20:10:34 +02:00
parent 3371455255
commit 4fa2a34447
14 changed files with 282 additions and 130 deletions
+34
View File
@@ -89,6 +89,40 @@ def test_application_update_creates_timeline_events_for_status_notes_and_contact
assert ApplicationTimelineEvent.EventType.CONTACT_UPDATED in event_types
@pytest.mark.integration
@pytest.mark.django_db
def test_pipeline_status_post_is_persistent_audited_and_user_scoped(client, job, user):
record_feedback(user=user, job=job, action="applied")
application = Application.objects.get(user=user, job=job)
client.force_login(user)
response = client.post(
reverse("jobs:application-status", kwargs={"pk": application.pk}),
{"status": Application.Status.INTERVIEW},
)
assert response.status_code == 302
application.refresh_from_db()
assert application.status == Application.Status.INTERVIEW
assert ApplicationTimelineEvent.objects.filter(
application=application,
user=user,
event_type=ApplicationTimelineEvent.EventType.STATUS_CHANGED,
metadata__from=Application.Status.APPLIED,
metadata__to=Application.Status.INTERVIEW,
).exists()
other = get_user_model().objects.create_user(username="scoped-other")
other_application = Application.objects.create(user=other, job=job)
assert (
client.post(
reverse("jobs:application-status", kwargs={"pk": other_application.pk}),
{"status": Application.Status.OFFER},
).status_code
== 404
)
@pytest.mark.integration
@pytest.mark.django_db
def test_application_export_generates_sanitized_zip_payload(client, job, source, user, profile):