Update and delete subscription from Escut user interface #54 #66

Merged
brunelie merged 15 commits from update-subscription into main 2025-08-07 09:28:59 +02:00
Owner

Resolves #54

Resolves #54
brunelie requested reviews from eloi, felix 2025-07-08 10:57:50 +02:00
eloi approved these changes 2025-07-08 11:28:54 +02:00
eloi left a comment
Owner

Ça me semble bien ! À @felix.

Ça me semble bien ! À @felix.
brunelie force-pushed update-subscription from 9bcb34d361 to 8141ffa56f
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/pr/tests Pipeline was successful
ci/woodpecker/push/tests Pipeline was successful
2025-07-08 12:03:27 +02:00
Compare
felix left a comment
Owner

🚁

🚁
@ -28,3 +49,3 @@
can_subscribe = "C'est pour moi"
can_subscribe = "Changer ma formule"
count_has = string.count(has_subscription)
count_can = string.count(can_subscribe)
Owner

You could simplify this by using mustcontain like in the other display tests.

You could simplify this by using `mustcontain` like in the other display tests.
Author
Owner

mustcontain isn't specific enough for what I intended to do :
We have 2 plans.
For this test, the user has 1 active plan and the other is available. Which means the page must display once "C'est pour moi" and once "Changer ma formule". No less and no more.
With mustcontain, the test would still be green if one of the subscriptions was displayed 10 times, even though it's not what we want to display.

but maybe it's overkill to do it the way I did ?

`mustcontain` isn't specific enough for what I intended to do : We have 2 plans. For this test, the user has 1 active plan and the other is available. Which means the page must display once "C'est pour moi" and once "Changer ma formule". No less and no more. With `mustcontain`, the test would still be green if one of the subscriptions was displayed 10 times, even though it's not what we want to display. but maybe it's overkill to do it the way I did ?
Owner

Okay I didn't understand that. You're right then.
You could maybe make it more readable like this (but it's basically the same).

def test_plans_display_logged(client, logged_user, lago_subscription_created):
    res = client.get("/offre")
    assert res.text.count("C'est mon abonnement") == 1
    assert res.text.count("Changer ma formule") == 1
Okay I didn't understand that. You're right then. You could maybe make it more readable like this (but it's basically the same). ```python def test_plans_display_logged(client, logged_user, lago_subscription_created): res = client.get("/offre") assert res.text.count("C'est mon abonnement") == 1 assert res.text.count("Changer ma formule") == 1 ```
Author
Owner

thanks for the simpler alternative, I pushed it !

thanks for the simpler alternative, I pushed it !
felix marked this conversation as resolved
@ -53,0 +84,4 @@
"webhook_type": "subscription.started",
"subscription": {
"customer": {"external_id": iam_user.user_name},
"plan_code": "code_first1",
Owner

This should be code_first2 as we discussed.

This should be `code_first2` as we discussed.
brunelie marked this conversation as resolved
fix: UX and UI improvements
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/pr/tests Pipeline was successful
ci/woodpecker/push/tests Pipeline was successful
505fe2665d
feat: information message on prices page about downgrades
All checks were successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/pr/tests Pipeline was successful
ci/woodpecker/push/tests Pipeline was successful
53699b5cd0
feat: user can see pending subscriptions after a downgrade
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/push/tests Pipeline was successful
ci/woodpecker/pr/tests Pipeline was successful
a89e21131f
brunelie force-pushed update-subscription from a89e21131f
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/push/tests Pipeline was successful
ci/woodpecker/pr/tests Pipeline was successful
to 6135341215
Some checks failed
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/tests Pipeline failed
2025-07-09 15:48:32 +02:00
Compare
fix: corrects payload in test_subscription_updated
Some checks failed
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/pr/tests Pipeline failed
e563898ebf
refactor: refacto test_plans_display_logged
Some checks failed
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/tests Pipeline failed
38b618fd9c
brunelie deleted branch update-subscription 2025-08-07 09:29:00 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yaal/escut!66
No description provided.