Skip to content

Commit

Permalink
Unarchive on accepting a job application
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisfreitag committed Sep 12, 2024
1 parent adaf51e commit bc46574
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions itou/job_applications/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,7 @@ def unset_processed_at(self, *args, **kwargs):
@before_transition(
JobApplicationWorkflow.TRANSITION_PROCESS,
JobApplicationWorkflow.TRANSITION_POSTPONE,
JobApplicationWorkflow.TRANSITION_ACCEPT,
JobApplicationWorkflow.TRANSITION_MOVE_TO_PRIOR_TO_HIRE,
JobApplicationWorkflow.TRANSITION_CANCEL_PRIOR_TO_HIRE,
JobApplicationWorkflow.TRANSITION_REFUSE,
Expand Down
15 changes: 15 additions & 0 deletions tests/job_applications/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,21 @@ def test_job_application_transition_unarchives(transition, from_state):
assert job_application.archived_at is None


@pytest.mark.parametrize(
"transition_name",
[
JobApplicationWorkflow.TRANSITION_ACCEPT,
JobApplicationWorkflow.TRANSITION_MOVE_TO_PRIOR_TO_HIRE,
],
)
def test_unarchive_job_application(transition_name):
job_application = JobApplicationFactory(state=JobApplicationState.PROCESSING, archived_at=timezone.now())
user = job_application.to_company.members.get()
getattr(job_application, transition_name)(user=user)
job_application.refresh_from_db()
assert job_application.archived_at is None


class JobApplicationXlsxExportTest(TestCase):
def test_xlsx_export_contains_the_necessary_info(self, *args, **kwargs):
create_test_romes_and_appellations(["M1805"], appellations_per_rome=2)
Expand Down

0 comments on commit bc46574

Please sign in to comment.