-
Notifications
You must be signed in to change notification settings - Fork 42
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
test: Add tests for permissions #205
Conversation
abhiabhi94
commented
May 15, 2021
•
edited
Loading
edited
- almost but takes test coverage to 100%.
7c6a3d2
to
0576d67
Compare
Hey, see what I found testing the current permissions. The permission https://github.com/django/django/blob/main/django/contrib/auth/models.py#L35-L56 Was this done knowingly? |
i can't think of a scenario, where this condition would become false Comment/comment/migrations/0008_comment_urlhash.py Lines 14 to 18 in 0e22c13
should we probably remove this? |
f232b81
to
d4e5aed
Compare
Yes, we are using |
This function was added to comply old version with the new one. I believe it will be always needed. |
no, my bad i should have explained the exact thing that i wanted to mention. I was just talking about the scenario where As the attribute will only be created and filled in this migration itself, i can't think of a real world scenario where a comment can have I think we can safely remove this. |
Is this a good thing? should we be concerned about it. I can adjust the current tests to bypass this thing but just wanted an extra set of brains to just discuss. |
I think yes. |
I am not sure I fully got what your concern is here? We are using django default permission or we create it if not exist, what's the issue? |
nothing, i can't think of a reason to support my concern now. maybe i was just concerned that we may be overriding something from the default permissions, but we actually aren't. so we should be safe i think. |
d4e5aed
to
b287575
Compare
- almost but takes the test coverage to 100%. Remove unnecessary check for previous urlhash from migrations - since the attribute was created and filled in this migration itself, it wasn't necessary.
b287575
to
6084ad4
Compare
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 @abhiabhi94