Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add tests for REST API #1035

wants to merge 3 commits into from

Conversation

fabienheureux
Copy link
Member

Description succincte du problème résolu

J'ai ajouté des petits tests pour l'API, cf #1034

@fabienheureux fabienheureux requested a review from a team as a code owner November 15, 2024 10:29
@fabienheureux fabienheureux requested review from kolok and maxcorbeau and removed request for a team November 15, 2024 10:29
Copy link
Contributor

@kolok kolok left a 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)
Copy link
Contributor

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"""
Copy link
Contributor

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"""
Copy link
Contributor

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"""
Copy link
Contributor

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 ?

Copy link
Member Author

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é 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants