Skip to content

Commit

Permalink
search: don't show apply button when company doesn't accept applications
Browse files Browse the repository at this point in the history
  • Loading branch information
EwenKorr committed Jan 17, 2025
1 parent 88deb2f commit 1f71d3c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion itou/templates/companies/includes/_card_siae.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h3>{{ siae.display_name }}</h3>
{% endif %}
</div>
</div>
{% if siae.active_job_descriptions %}
{% if siae.active_job_descriptions and not siae.block_job_applications %}
<hr class="m-0">
{% if job_app_to_transfer|default:False %}
<div class="c-box--results__body">
Expand Down
18 changes: 17 additions & 1 deletion tests/www/search/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
from itou.companies.models import Company
from itou.jobs.models import Appellation, Rome
from tests.cities.factories import create_city_guerande, create_city_saint_andre, create_city_vannes
from tests.companies.factories import CompanyFactory, CompanyMembershipFactory, JobDescriptionFactory
from tests.companies.factories import (
CompanyFactory,
CompanyMembershipFactory,
CompanyWithMembershipAndJobsFactory,
JobDescriptionFactory,
)
from tests.job_applications.factories import JobApplicationFactory
from tests.jobs.factories import create_test_romes_and_appellations
from tests.prescribers.factories import PrescriberOrganizationFactory
Expand Down Expand Up @@ -399,6 +404,17 @@ def test_is_searchable(self, client):
assertContains(response, f"<h3>{searchable_company.display_name}</h3>")
assertNotContains(response, f"<h3>{unsearchable_company.display_name}</h3>")

def test_apply_button_is_not_shown_when_applications_are_blocked(self, client):
guerande = create_city_guerande()

company = CompanyWithMembershipAndJobsFactory(
department="44", coords=guerande.coords, post_code="44350", block_job_applications=True
)
response = client.get(self.URL, {"city": guerande.slug})

apply_url = f"{reverse('apply:start', kwargs={'company_pk': company.pk})}"
assertNotContains(response, apply_url)

def test_results_links_from_job_seeker_list(self, client):
"""
When applying from "Mes candidats"
Expand Down

0 comments on commit 1f71d3c

Please sign in to comment.