aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_authentication.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_authentication.py')
-rw-r--r--tests/test_authentication.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test_authentication.py b/tests/test_authentication.py
index caabcc21..19fe6043 100644
--- a/tests/test_authentication.py
+++ b/tests/test_authentication.py
@@ -205,7 +205,10 @@ class TokenAuthTests(TestCase):
def test_post_json_makes_one_db_query(self):
"""Ensure that authenticating a user using a token performs only one DB query"""
auth = "Token " + self.key
- func_to_test = lambda: self.csrf_client.post('/token/', {'example': 'example'}, format='json', HTTP_AUTHORIZATION=auth)
+
+ def func_to_test():
+ return self.csrf_client.post('/token/', {'example': 'example'}, format='json', HTTP_AUTHORIZATION=auth)
+
self.assertNumQueries(1, func_to_test)
def test_post_form_failing_token_auth(self):