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
Ajout de tests bouts en bouts #19
Conversation
8225b7d
to
ea308df
Compare
inclusion_connect/tests.py
Outdated
ApplicationFactory(client_id=OIDC_PARAMS["client_id"]) | ||
user = UserFactory() | ||
|
||
# Entry point is OIDC registration endpoint -> redirected to accounts:registration |
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.
Le commentaire est faux (copy-pasta) et paraphrase le code.
# Entry point is OIDC registration endpoint -> redirected to accounts:registration |
inclusion_connect/tests.py
Outdated
response = client.get(auth_complete_url, follow=True) | ||
assert response.status_code == 400 | ||
|
||
# Entry point is OIDC activation endpoint -> redirected to accounts:registration |
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.
Le commentaire est faux (copy-pasta) et paraphrase le code.
# Entry point is OIDC activation endpoint -> redirected to accounts:registration |
inclusion_connect/tests.py
Outdated
ApplicationFactory(client_id=OIDC_PARAMS["client_id"]) | ||
user = UserFactory.build() | ||
|
||
# Entry point is OIDC registration endpoint -> redirected to accounts:registration |
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.
Le commentaire paraphrase le code.
# Entry point is OIDC registration endpoint -> redirected to accounts:registration |
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'ai corrigé les commentaires.
Par contre, sur des tests de ce niveau là, et aussi long, je trouve plus clair d'avoir des explication en prose.
Ce n'est pas ton avis ?
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.
Je ne trouve pas. Le bout de code fait :
auth_url = reverse("oidc_overrides:authorize")
auth_complete_url = add_url_params(auth_url, OIDC_PARAMS)
response = client.get(auth_complete_url)
assertRedirects(response, reverse("accounts:login"))
oidc_overrides
-> c’est un endpoint oidcassertRedirects(response, reverse("accounts:login"))
-> redirige versaccounts:login
Le commentaire ne m’apprend rien. Le commentaire est plutôt pour expliquer pourquoi, peut-être : Compatibility with OIDC, Django auth handles authentication.
.
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.
Après, ce n’est que du commentaire, donc tu peux faire comme tu préfères, je m’en accommoderai facilement.
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.
Le soucis c'est plus les étapes suivantes à faire des get/post sur response.url (ce qui peut être plus dur à suivre donc).
Je vais tester de limiter les commentaires aux endroits où l'url appelée n'est pas explicite, et sans expliquer ce qui se passe ensuite.
25209e3
to
b4e4e24
Compare
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’imagine qu’il manque un rebase pour lier l’utilisateur et l’application.
Sur le dernier commit : s/functionnal/functional
.
089a994
to
d3908cf
Compare
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.
Autrement c’est tout bon :)
We want to test every flow described in our product documentation
This way, if is_authenticated becomes a method, it would crash
d3908cf
to
9b94f24
Compare
**Carte Notion : ** https://www.notion.so/plateforme-inclusion/Refonte-Tester-les-parcours-d-crits-dans-la-doc-produit-480308abed9644e986adf329d2bd09fd?pvs=4
Pourquoi ?
Pour s’assurer que chaque parcours utilisateur fonctionne de A à Z
Il manque encore (à faire dans une autre PR)
Ne lire que le dernier commit