Skip to content

Commit

Permalink
Hide update button with test, probably not the best behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisfreitag committed Jan 9, 2025
1 parent a325337 commit 4e1f85e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions itou/www/apply/views/process_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ def get_context_data(self, **kwargs):
return data | {
"job_app_to_transfer": self.job_application,
"matomo_custom_title": data["matomo_custom_title"] + " (transfert)",
"can_update_job_description": False,
}


Expand Down
28 changes: 28 additions & 0 deletions tests/www/apply/test_process_external_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,34 @@ def test_step_1(client, snapshot):
)


def test_step_1_same_company(client):
create_test_romes_and_appellations(["N1101"], appellations_per_rome=1)
vannes = create_city_vannes()
company = CompanyFactory(coords=vannes.coords, post_code="56760", with_membership=True)
job = JobDescriptionFactory(company=company)

job_application = JobApplicationFactory(state=JobApplicationState.REFUSED, to_company=company)
employer = job_application.to_company.members.get()
client.force_login(employer)

response = client.get(
reverse(
"apply:job_application_external_transfer_step_1_job_description_card",
kwargs={"job_application_id": job_application.pk, "job_description_id": job.pk},
)
)
assertNotContains(response, "Postuler")
assertContains(
response,
"<span>Transférer la candidature</span>",
count=1,
)
assertNotContains(
response,
reverse("companies_views:update_job_description", kwargs={"job_description_id": job.pk}),
)


def test_step_2_same_company(client):
job_application = JobApplicationFactory(state=JobApplicationState.REFUSED, for_snapshot=True)
company = job_application.to_company
Expand Down

0 comments on commit 4e1f85e

Please sign in to comment.