-
Notifications
You must be signed in to change notification settings - Fork 275
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
Missing test for deleting authenticated users #1168
Missing test for deleting authenticated users #1168
Conversation
✅ Deploy Preview for activist-org canceled.
|
Thank you for the pull request! ❤️The activist team will do our best to address your contribution as soon as we can. If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the |
Maintainer ChecklistThe following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)
|
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.
First PR Commit Check
- The commit messages for the remote branch of a new contributor should be checked to make sure their email is set up correctly so that they receive credit for their contribution
- The contributor's name and icon in remote commits should be the same as what appears in the PR
- If there's a mismatch, the contributor needs to make sure that the email they use for GitHub matches what they have for
git config user.email
in their local activist repo (can be set withgit config --global user.email "GITHUB_EMAIL"
)
Do you want to take a first glance at this, @mattburnett-repo? :) |
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.
if response.status_code == 200:
delete_response = client.delete(
path="/v1/auth/delete/",
data={"pk": user.id}
)
assert delete_response.status_code == 200
Overall, looks really good! I would suggest we take out the 'if response.status_code == 200' line. We want the delete to happen / be tested no matter what the rest of the test does.
I will remove the if block and submit again ASAP. Thank you for the suggestion. |
So I tried removing the if block and when I ran the tests again, the test fails throwing an assertion error 401. In order for the user to be deleted, the user has be an authenticated user. And the only way I can think of ensuring that only authenticated users can delete is by using that IF block. Unless I am missing something. |
ah! That makes sense. Let's keep things simple and put the 'if' statement back in. Thanks for responding so quickly! |
Thank you! @mattburnett-repo Since I have not put in a new PR I am guessing the current PR is good? @andrewtavis I'll start working on the remaining tests ASAP. |
Minor change to left justify the function docstrings and break them onto a new line always. I find it makes it easier to read these things when they're all structured in a similar way 😊 |
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.
Thanks for the great first contribution here, @sh-ran! Really looking forward to further collaborations with you 😊 And also thanks for the review support, @mattburnett-repo! 🚀
Contributor checklist
Description
Related issue