summaryrefslogtreecommitdiff
path: root/tests/auth_tests/test_decorators.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auth_tests/test_decorators.py')
-rw-r--r--tests/auth_tests/test_decorators.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/auth_tests/test_decorators.py b/tests/auth_tests/test_decorators.py
index e585b28bd5..fa2672beb4 100644
--- a/tests/auth_tests/test_decorators.py
+++ b/tests/auth_tests/test_decorators.py
@@ -1,7 +1,5 @@
from asyncio import iscoroutinefunction
-from asgiref.sync import sync_to_async
-
from django.conf import settings
from django.contrib.auth import models
from django.contrib.auth.decorators import (
@@ -374,7 +372,7 @@ class UserPassesTestDecoratorTest(TestCase):
def test_decorator_async_test_func(self):
async def async_test_func(user):
- return await sync_to_async(user.has_perms)(["auth_tests.add_customuser"])
+ return await user.ahas_perms(["auth_tests.add_customuser"])
@user_passes_test(async_test_func)
def sync_view(request):
@@ -410,7 +408,7 @@ class UserPassesTestDecoratorTest(TestCase):
async def test_decorator_async_view_async_test_func(self):
async def async_test_func(user):
- return await sync_to_async(user.has_perms)(["auth_tests.add_customuser"])
+ return await user.ahas_perms(["auth_tests.add_customuser"])
@user_passes_test(async_test_func)
async def async_view(request):