Skip to content

Conversation

janlis-ff
Copy link
Contributor

@janlis-ff janlis-ff commented Oct 16, 2022

The reason behind this proposal is to fully enable permission_classes comparison, e.g. in tests:

# myapp/views.py

from rest_framework.views import APIView
from rest_framework.permissions import IsAdminUser
from myapp.permissions import MyPermission


class MyView(APIView):
    permission_classes = [MyPermission | IsAdminUser]
    # ...
# myapp/tests/views/test_my_view.py

from myapp.views import MyView
from rest_framework.permissions import IsAdminUser
from myapp.permissions import MyPermission


def test__permission_classes():
    cls = MyView
    assert cls.permission_classes == [MyPermission | IsAdminUser]

I'd love to submit an actual test, but being a first-time contributor here I'm not sure where and how exactly would it fit in just by looking at tests/test_permissions.py.

Have a nice day!

@lovelydinosaur
Copy link
Contributor

🤷‍♂️. Okay.

@lovelydinosaur lovelydinosaur merged commit 0cb6937 into encode:master Oct 17, 2022
@janlis-ff janlis-ff deleted the add-operand-holder-__eq__ branch October 17, 2022 10:42
@djowett
Copy link

djowett commented Dec 3, 2024

Just a passing note while reviewing an upgrade: should this not also be added to SingleOperandHolder?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants