anitab-org / anitab-org/mentorship-backend

Add tests for Assigning a new admin API

Open
#141 20 comments 0 reactions 0 assignees View on GitHub
Category: Coding Status: Available Type: Testing
Dominant language
Python
Stars
200
Forks
449
PR merge metrics
No merged PRs in 30d

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.