Skip to content

Commit

Permalink
wip: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EwenKorr committed Sep 13, 2024
1 parent 9ef567e commit 638e4f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/users/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class Params:

@factory.lazy_attribute
def nir(self):
gender = random.choice([1, 2])
gender = "1" if self.user.title == "M" else "2"
if self.birthdate:
year = self.birthdate.strftime("%y")
month = self.birthdate.strftime("%m")
Expand Down
8 changes: 7 additions & 1 deletion tests/www/apply/test_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3097,7 +3097,7 @@ def _check_everything_allowed(self, user, extra_post_data_1=None):
PROCESS_TITLE = "Modification du compte candidat"

post_data = {
"title": "M",
"title": self.job_seeker.title,
"first_name": NEW_FIRST_NAME,
"last_name": "New last name",
"birthdate": self.job_seeker.jobseeker_profile.birthdate,
Expand Down Expand Up @@ -3657,6 +3657,8 @@ def test_detect_existing_job_seeker(client):

job_seeker = JobSeekerFactory(
jobseeker_profile__nir="",
jobseeker_profile__birthdate=datetime.date(1997, 1, 1),
title="M",
first_name="Jérémy",
email="[email protected]",
)
Expand Down Expand Up @@ -3734,7 +3736,11 @@ def test_detect_existing_job_seeker(client):
"lack_of_nir_reason": "",
"lack_of_nir": False,
}
print("-----------------------------------")
print(post_data)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High test

This expression logs
sensitive data (private)
as clear text.
print("-----------------------------------")
response = client.post(next_url, data=post_data)

assertContains(
response,
(
Expand Down

0 comments on commit 638e4f8

Please sign in to comment.