From 59c7478075bb0592ef7af5b53440a75f0d35aa0f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 3 Sep 2014 13:17:01 +0200 Subject: [PATCH] Patch client test fixture with useful login method. This removes django-testclient-extensions because it doesn't compatible with django 1.7. --- tests/fixtures.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/fixtures.py b/tests/fixtures.py index 02b853bd..5c9bfa21 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -41,15 +41,13 @@ class PartialMethodCaller: @pytest.fixture def client(): from django.test.client import Client - from django.test.client import MULTIPART_CONTENT class _Client(Client): def login(self, user=None, backend="django.contrib.auth.backends.ModelBackend", **credentials): if user is None: return super().login(**credentials) - # This will be changed on django1.7 branch with other location - with mock.patch('django.test.client.authenticate') as authenticate: + with mock.patch('django.contrib.auth.authenticate') as authenticate: user.backend = backend authenticate.return_value = user return super().login(**credentials)