-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add tests for REST API #1035
base: main
Are you sure you want to change the base?
Add tests for REST API #1035
Conversation
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.
Attention, il y a un test qui plante
"""Test the /actions endpoint""" | ||
response = client.get(f"{BASE_URL}/actions") | ||
assert response.status_code == 200 | ||
assert isinstance(response.json(), list) |
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.
list vide ?
|
||
@pytest.mark.django_db | ||
def test_get_acteurs_types(client): | ||
"""Test the /acteurs/types endpoint""" |
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.
il manque les fixtures ?
|
||
@pytest.mark.django_db | ||
def test_get_acteurs_services(client): | ||
"""Test the /acteurs/services endpoint""" |
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.
idem pour les fixtures ?
|
||
@pytest.mark.django_db | ||
def test_autocomplete_epci(client): | ||
"""Test the /autocomplete/configurateur endpoint""" |
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.
Est-ce qu'il ne faut pas mock l'appel à l'API des EPCI pour ne pas en dépendre dans les tests ?
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'y ai pensé, j'ai un peu flemmé 😬
Description succincte du problème résolu
J'ai ajouté des petits tests pour l'API, cf #1034