-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(PC-34162)[API] feat: credit v3 - create new deposit when v3 active #16105
base: master
Are you sure you want to change the base?
Conversation
Visit the preview URL for this PR (updated for commit e2e2058): https://pc-pro-testing--pr16105-pc-34162-vredit-v3-i-6vgv2u35.web.app (expires Sat, 01 Feb 2025 10:05:46 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 032d233ee67e1c50d6af12e29c936c7076770eb1 |
f69eed9
to
938eeaa
Compare
938eeaa
to
e2e2058
Compare
def test_create_deposit_age_18_even_when_ff_credit_v3_is_active(self): | ||
user = users_factories.HonorStatementValidatedUserFactory(validatedBirthDate=datetime.date(2007, 1, 1)) | ||
assert user.age == 18 | ||
|
||
deposit = api.create_deposit(user, "created by test", users_models.EligibilityType.AGE18) | ||
|
||
assert deposit.type == models.DepositType.GRANT_18 | ||
assert deposit.amount == 300 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
j'avais en tête de toujours créer des vieux deposits
18
pré décret et 17_18
post décret pour les majeurs
je pense que ça simplifiera le travail de la data et les investigations de bugs
scénario rare, mais si on découvre pour une raison x ou y qu'un jeune a 17 ans plutôt que 18, on n'aura pas à changer le type de deposit
pour lui donner le recrédit 17
assert deposit.amount == 300 | ||
|
||
@time_machine.travel("2025-03-03") | ||
def test_17yo_becomes_17_18_when_ff_credit_v3_is_active(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nit) la classe entière de test est sous FF activé, donc pas besoin de le repréciser dans le nom de test
return compute_underage_deposit_expiration_datetime(beneficiary.birth_date) | ||
|
||
# deposit_type == DepositType.GRANT_18 | ||
expiration_date = datetime.datetime.utcnow().date() + relativedelta(years=conf.GRANT_18_VALIDITY_IN_YEARS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on n'avait pas dit que les crédits 18 expirent aussi la veille des 21 ans ?
But de la pull request
Ticket Jira (ou description si BSR) : https://passculture.atlassian.net/browse/PC-34162
Créer le nouveau type de deposit
Vide pour l'instant
Vérifications