anitab-org / anitab-org/mentorship-backend
Add tests for Assigning a new admin API
- Langage dominant
- Python
- Étoiles
- 200
- Forks
- 449
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
## Description
As a developer,
I need have tests for assigning a new admin feature,
so that I can have the feature coverage and make sure it's working properly.
Have a test function for each of this cases:
- Assigning a user which is already an admin -> should receive a message saying that the user is already an admin
- Assigning a user which is not an admin -> should become an admin
- Assigning a user as an admin, when the current user is not an admin -> should receive an error message
- Assigning a non-existent user -> should receive error message
- Try using the API without sending authentication token -> should receive an error message
You can test your tests running:
```
python -m unittest discover tests
```
## Acceptance Criteria
### Update [Required]
- [ ] Create a test file, on tests/admin folder, with test cases for assigning a new admin API (you can follow this test case example https://github.com/systers/mentorship-backend/blob/develop/tests/users/test_api_list_users.py)
## Definition of Done
- [ ] All of the required items are completed.
- [x] Approval by 1 mentor.
## Estimation
4 hours
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.