Commit 7d32129b by Calen Pennington

Use the Django TestClient for branding unit tests, so that middleware is cleaned up properly

parent fc1e0b66
...@@ -16,7 +16,6 @@ from nose.plugins.attrib import attr ...@@ -16,7 +16,6 @@ from nose.plugins.attrib import attr
from edxmako.shortcuts import render_to_response from edxmako.shortcuts import render_to_response
from branding.views import index from branding.views import index
from edxmako.tests import mako_middleware_process_request
import student.views import student.views
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.factories import CourseFactory
...@@ -63,11 +62,9 @@ class AnonymousIndexPageTest(ModuleStoreTestCase): ...@@ -63,11 +62,9 @@ class AnonymousIndexPageTest(ModuleStoreTestCase):
anonymous and start dates are being checked. It replaces a previous anonymous and start dates are being checked. It replaces a previous
test as it solves the issue in a different way test as it solves the issue in a different way
""" """
request = self.factory.get('/') self.client.logout()
request.user = AnonymousUser() response = self.client.get(reverse('root'))
self.assertEqual(response.status_code, 200)
mako_middleware_process_request(request)
student.views.index(request)
@override_settings(FEATURES=FEATURES_WITH_STARTDATE) @override_settings(FEATURES=FEATURES_WITH_STARTDATE)
def test_anon_user_with_startdate_index(self): def test_anon_user_with_startdate_index(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment