Skip to content

Commit

Permalink
DO NOT MERGE ME - fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
celine-m-s committed Mar 15, 2024
1 parent 34243b8 commit c36a9fe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion itou/templates/static/security/security.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Contact: mailto:tech@inclusion.beta.gouv.fr
Expires: 2024-03-19T12:00:00.000Z
Expires: 2024-09-19T12:00:00.000Z
Preferred-Languages: fr,en
Canonical: https://emplois.inclusion.beta.gouv.fr/.well-known/security.txt
Policy: https://github.com/gip-inclusion/les-emplois/blob/master/.github/SECURITY.md
26 changes: 14 additions & 12 deletions tests/www/approvals_views/test_list.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import datetime

from dateutil.relativedelta import relativedelta
from django.urls import reverse
from django.utils import timezone
Expand Down Expand Up @@ -125,42 +127,42 @@ def test_approval_state_filters(self, client):
company = CompanyFactory(with_membership=True)

expired_approval = ApprovalFactory(
start_at=now - relativedelta(years=3),
end_at=now - relativedelta(years=1),
start_at=now - datetime.timedelta(days=3 * 365),
end_at=now - datetime.timedelta(days=365),
with_jobapplication=True,
with_jobapplication__to_company=company,
)
future_approval = ApprovalFactory(
start_at=now + relativedelta(days=1),
start_at=now + datetime.timedelta(days=1),
with_jobapplication=True,
with_jobapplication__to_company=company,
)
valid_approval = ApprovalFactory(
start_at=now - relativedelta(years=1),
start_at=now - datetime.timedelta(days=365),
with_jobapplication=True,
with_jobapplication__to_company=company,
)
suspended_approval = ApprovalFactory(
start_at=now - relativedelta(years=1),
start_at=now - relativedelta(days=365),
with_jobapplication=True,
with_jobapplication__to_company=company,
)
SuspensionFactory(
approval=suspended_approval,
start_at=now - relativedelta(days=1),
end_at=now + relativedelta(days=1),
start_at=now - datetime.timedelta(days=1),
end_at=now + datetime.timedelta(days=1),
)
# Add 2 suspensions on valid approval because it used to cause duplicates
# when valid and suspended filters were selected
SuspensionFactory(
approval=valid_approval,
start_at=now - relativedelta(days=10),
end_at=now - relativedelta(days=9),
start_at=now - datetime.timedelta(days=10),
end_at=now - datetime.timedelta(days=9),
)
SuspensionFactory(
approval=valid_approval,
start_at=now - relativedelta(days=3),
end_at=now - relativedelta(days=2),
start_at=now - datetime.timedelta(days=3),
end_at=now - datetime.timedelta(days=2),
)

employer = company.members.first()
Expand Down Expand Up @@ -234,7 +236,7 @@ def test_approval_state_filters(self, client):

assertContains(response, "366 jours")

assertContains(response, "730 jours")
assertContains(response, "729 jours")

assertContains(response, "0 jour")

Expand Down

0 comments on commit c36a9fe

Please sign in to comment.