Browse files

Changed utils/ tests to use RequestFactory

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
spookylukey committed May 23, 2011
1 parent 55c2c30 commit e683beb6079122cd8ab90909ea8c4e7a6cfde36c
@@ -1,19 +1,39 @@
from django.test import TestCase
from django.http import HttpResponse
from django.middleware.doc import XViewMiddleware
from django.test import TestCase, RequestFactory
from django.utils.decorators import decorator_from_middleware
xview_dec = decorator_from_middleware(XViewMiddleware)
def xview(request):
return HttpResponse()
class ClassXView(object):
def __call__(self, request):
return HttpResponse()
class_xview = xview_dec(ClassXView())
class DecoratorFromMiddlewareTests(TestCase):
Tests for view decorators created using
rf = RequestFactory()
def test_process_view_middleware(self):
Test a middleware that implements process_view.
def test_callable_process_view_middleware(self):
Test a middleware that implements process_view, operating on a callable class.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -29,5 +29,4 @@
# admin widget tests
(r'widget_admin/', include('regressiontests.admin_widgets.urls')),
(r'^utils/', include('regressiontests.utils.urls')),

0 comments on commit e683beb

Please sign in to comment.