Django's is_authenticated now returns an object

This commit is contained in:
Mark Davidoff 2018-10-29 08:22:54 -07:00 committed by GitHub
parent 9d001cd84c
commit 88fd222f99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,7 @@ from django.contrib.auth.models import Group, Permission, User
from django.db import models from django.db import models
from django.test import TestCase from django.test import TestCase
from django.urls import ResolverMatch from django.urls import ResolverMatch
from django.utils.deprecation import CallableBool
from rest_framework import ( from rest_framework import (
HTTP_HEADER_ENCODING, authentication, generics, permissions, serializers, HTTP_HEADER_ENCODING, authentication, generics, permissions, serializers,
@ -544,7 +545,7 @@ class CustomPermissionsTests(TestCase):
class FakeUser: class FakeUser:
def __init__(self, auth=False): def __init__(self, auth=False):
self.is_authenticated = auth self.is_authenticated = CallableBool(auth)
class PermissionsCompositionTests(TestCase): class PermissionsCompositionTests(TestCase):