Mentorship-backend: Add tests for Assigning a new admin API

Created on 30 Aug 2018  Â·  18Comments  Â·  Source: anitab-org/mentorship-backend

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

Coding Testing

Most helpful comment

Sory for being late, I am working on this issue

On Tue, Mar 23, 2021, 1:21 AM Vaishnavi Joshi @.*>
wrote:

@b-thebest https://github.com/b-thebest hey any updates?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/anitab-org/mentorship-backend/issues/141#issuecomment-804348775,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJ6VVH3IFZSK3QTOM34XPI3TE6NSLANCNFSM4FSKNVVA
.

All 18 comments

@systers/maintainers-mentorship-backend need approval on this if you agree.

The author of the issue cannot approve the issue.

Can I claim this issue?

@KritiRav yes you can :) tell us if you need help or get stuck

@KritiRav any updates on this?

@isabelcosta Please have a look at the code. If there is something missing, I will add on to that.

@isabelcosta I just found out that issue #142 is also solved by my PR. so adding that.

Is this issue resolved?

@vermastuti no its not, I see not tests in admin folder calling the Admin Assignment API. Tests of this kind usually begin with test_api_*.
Are you interested in working on this?

Yeah, I would like to work on this.

@vermastuti I am sorry for the delay in the response. I just assign it to you, if you are not interested in the issue, let me know and I'll make it available again :)

@vermastuti Are you still interested in this issue??

Making the issue available due to inactivty.

Anyone working on this ?

Anyone working on this ?

Nope it is marked as status available would you like to work on it?

Okay, please assign this issue to me @epicadk

@b-thebest hey any updates?

Sory for being late, I am working on this issue

On Tue, Mar 23, 2021, 1:21 AM Vaishnavi Joshi @.*>
wrote:

@b-thebest https://github.com/b-thebest hey any updates?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/anitab-org/mentorship-backend/issues/141#issuecomment-804348775,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJ6VVH3IFZSK3QTOM34XPI3TE6NSLANCNFSM4FSKNVVA
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daksha-aeer picture daksha-aeer  Â·  6Comments

rpattath picture rpattath  Â·  4Comments

snitin315 picture snitin315  Â·  7Comments

mtreacy002 picture mtreacy002  Â·  7Comments

isabelcosta picture isabelcosta  Â·  7Comments