Skip to content
Browse files

Shuffled around RequestFactory

  • Loading branch information...
1 parent 660aace commit 9fb23189817e9d75d13845f72fe6bb01d5cfd62b @bfirsh committed Jun 1, 2010
Showing with 5 additions and 9 deletions.
  1. +5 −2 class_based_views/tests/tests/base.py
  2. +0 −7 class_based_views/tests/utils.py
View
7 class_based_views/tests/tests/base.py
@@ -1,7 +1,8 @@
from class_based_views.base import View
-from class_based_views.tests.utils import TestCase
+from class_based_views.tests.utils import RequestFactory
from django.core.exceptions import ImproperlyConfigured
from django.utils import simplejson
+import unittest
class AboutView(View):
template_name = 'views/about.html'
@@ -61,7 +62,9 @@ class ContextProcessorJsonView(JsonView):
]
-class ViewTest(TestCase):
+class ViewTest(unittest.TestCase):
+ rf = RequestFactory()
+
def _assert_about(self, response):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.content, '<h1>About</h1>')
View
7 class_based_views/tests/utils.py
@@ -1,6 +1,5 @@
from django.test import Client
from django.core.handlers.wsgi import WSGIRequest
-import unittest
class RequestFactory(Client):
"""
@@ -40,9 +39,3 @@ def request(self, **request):
environ.update(request)
return WSGIRequest(environ)
-
-class TestCase(unittest.TestCase):
- def __call__(self, *args, **kwargs):
- self.rf = RequestFactory()
- super(TestCase, self).__call__(*args, **kwargs)
-

0 comments on commit 9fb2318

Please sign in to comment.
Something went wrong with that request. Please try again.