aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_authentication.py
diff options
context:
space:
mode:
authorTom Christie2015-02-09 17:56:25 +0000
committerTom Christie2015-02-09 17:56:25 +0000
commit873fb69395de6fd230e4aba1b707c1f1979c0f07 (patch)
tree3ba0bdc1bbb21fcb7e36c37cd6170112c94a7054 /tests/test_authentication.py
parent235b98e427e2bae2b52fb386a42c8045724de251 (diff)
parent1a087c8c5bac6f157979ef9ff540c0eb23848fb4 (diff)
downloaddjango-rest-framework-873fb69395de6fd230e4aba1b707c1f1979c0f07.tar.bz2
Merge pull request #2530 from tomchristie/attribute-proxying-fix
Fix misleading `AttributeError` tracebacks on `Request` objects.
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):