From a493c83248535c9fa7f78815b16bce7e88bf7966 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 19 Dec 2012 23:12:27 +0000 Subject: urls, patterns, include imports move to compat to support incoming 1.3 thru 1.6 import compatability --- rest_framework/tests/request.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'rest_framework/tests/request.py') diff --git a/rest_framework/tests/request.py b/rest_framework/tests/request.py index 2850992d..2eb34cea 100644 --- a/rest_framework/tests/request.py +++ b/rest_framework/tests/request.py @@ -1,16 +1,15 @@ """ Tests for content parsing, and form-overloaded content parsing. """ -from django.conf.urls.defaults import patterns from django.contrib.auth.models import User from django.contrib.auth import authenticate, login, logout from django.contrib.sessions.middleware import SessionMiddleware from django.test import TestCase, Client +from django.test.client import RequestFactory from django.utils import simplejson as json - from rest_framework import status from rest_framework.authentication import SessionAuthentication -from django.test.client import RequestFactory +from rest_framework.compat import patterns from rest_framework.parsers import ( BaseParser, FormParser, -- cgit v1.2.3 From 125f027d2d124e2a483406d9d70e447b8634350c Mon Sep 17 00:00:00 2001 From: Mark Hughes Date: Thu, 20 Dec 2012 23:48:10 +0000 Subject: Added setter to the auth property --- rest_framework/tests/request.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'rest_framework/tests/request.py') diff --git a/rest_framework/tests/request.py b/rest_framework/tests/request.py index 2eb34cea..1f05ff8f 100644 --- a/rest_framework/tests/request.py +++ b/rest_framework/tests/request.py @@ -303,3 +303,11 @@ class TestUserSetter(TestCase): self.assertFalse(self.request.user.is_anonymous()) logout(self.request) self.assertTrue(self.request.user.is_anonymous()) + + +class TestAuthSetter(TestCase): + + def test_auth_can_be_set(self): + request = Request(factory.get('/')) + request.auth = 'DUMMY' + self.assertEqual(request.auth, 'DUMMY') -- cgit v1.2.3