diff options
| author | Tom Christie | 2011-05-04 09:21:17 +0100 |
|---|---|---|
| committer | Tom Christie | 2011-05-04 09:21:17 +0100 |
| commit | d373b3a067796b8e181be9368fa24e89c572c45e (patch) | |
| tree | eec24eb8f8813ce959511c3572a54c5ee645e227 /djangorestframework/tests/accept.py | |
| parent | 8756664e064a18afc4713d921c318cd968f18433 (diff) | |
| download | django-rest-framework-d373b3a067796b8e181be9368fa24e89c572c45e.tar.bz2 | |
Decouple views and resources
Diffstat (limited to 'djangorestframework/tests/accept.py')
| -rw-r--r-- | djangorestframework/tests/accept.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/djangorestframework/tests/accept.py b/djangorestframework/tests/accept.py index b12dc757..c5a3f69e 100644 --- a/djangorestframework/tests/accept.py +++ b/djangorestframework/tests/accept.py @@ -1,6 +1,6 @@ from django.test import TestCase from djangorestframework.compat import RequestFactory -from djangorestframework.resource import Resource +from djangorestframework.views import BaseView # See: http://www.useragentstring.com/ @@ -19,15 +19,15 @@ class UserAgentMungingTest(TestCase): def setUp(self): - class MockResource(Resource): + class MockView(BaseView): permissions = () def get(self, request): return {'a':1, 'b':2, 'c':3} self.req = RequestFactory() - self.MockResource = MockResource - self.view = MockResource.as_view() + self.MockView = MockView + self.view = MockView.as_view() def test_munge_msie_accept_header(self): """Send MSIE user agent strings and ensure that we get an HTML response, @@ -42,7 +42,7 @@ class UserAgentMungingTest(TestCase): def test_dont_rewrite_msie_accept_header(self): """Turn off REWRITE_IE_ACCEPT_HEADER, send MSIE user agent strings and ensure that we get a JSON response if we set a */* accept header.""" - view = self.MockResource.as_view(REWRITE_IE_ACCEPT_HEADER=False) + view = self.MockView.as_view(REWRITE_IE_ACCEPT_HEADER=False) for user_agent in (MSIE_9_USER_AGENT, MSIE_8_USER_AGENT, |
