Skip to content

Django's is_authenticated now returns an object -proof of issue #6287

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

Closed

Conversation

markddavidoff
Copy link
Contributor

@markddavidoff markddavidoff commented Oct 29, 2018

Test Change demonstrating the issue described in #6286.

@markddavidoff
Copy link
Contributor Author

Capturing Error output in case the travis results are archived:

=================================== FAILURES ===================================
__________________ PermissionsCompositionTests.test_and_false __________________
tests/test_permissions.py:556: in test_and_false
    assert composed_perm().has_permission(request, None) is False
rest_framework/permissions.py:34: in has_permission
    self.op2.has_permission(request, view)
E   TypeError: unsupported operand type(s) for &: 'CallableBool' and 'bool'
__________________ PermissionsCompositionTests.test_and_true ___________________
tests/test_permissions.py:562: in test_and_true
    assert composed_perm().has_permission(request, None) is True
rest_framework/permissions.py:34: in has_permission
    self.op2.has_permission(request, view)
E   TypeError: unsupported operand type(s) for &: 'CallableBool' and 'bool'
_______________ PermissionsCompositionTests.test_several_levels ________________
tests/test_permissions.py:585: in test_several_levels
    assert composed_perm().has_permission(request, None) is True
rest_framework/permissions.py:33: in has_permission
    self.op1.has_permission(request, view) &
rest_framework/permissions.py:33: in has_permission
    self.op1.has_permission(request, view) &
rest_framework/permissions.py:34: in has_permission
    self.op2.has_permission(request, view)

@xordoquy
Copy link
Collaborator

Yup and the output for Django 2.0+ are:

tests/test_permissions.py:12: in <module>
    from django.utils.deprecation import CallableBool
E   ImportError: cannot import name 'CallableBool'

@markddavidoff markddavidoff force-pushed the permission-comoposition-error branch 2 times, most recently from c9ed793 to 7a55ffe Compare October 29, 2018 16:15
@markddavidoff
Copy link
Contributor Author

Yes but just indicates that both the original test and my test changes are bad. It is a valid case for django 1.11 I will try to improve the test further

@markddavidoff markddavidoff force-pushed the permission-comoposition-error branch from 7a55ffe to 9bd3859 Compare October 29, 2018 17:00
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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy