Merge pull request #13694 from edx/common_cleanup/header_control

Move header_control from common to openedx/core
This commit is contained in:
Nimisha Asthagiri
2016-10-11 23:00:27 -04:00
committed by GitHub
9 changed files with 9 additions and 7 deletions

View File

@@ -335,7 +335,7 @@ simplefilter('ignore')
MIDDLEWARE_CLASSES = (
'crum.CurrentRequestUserMiddleware',
'request_cache.middleware.RequestCache',
'header_control.middleware.HeaderControlMiddleware',
'openedx.core.djangoapps.header_control.middleware.HeaderControlMiddleware',
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',

View File

@@ -1088,7 +1088,7 @@ MIDDLEWARE_CLASSES = (
'request_cache.middleware.RequestCache',
'mobile_api.middleware.AppVersionUpgrade',
'header_control.middleware.HeaderControlMiddleware',
'openedx.core.djangoapps.header_control.middleware.HeaderControlMiddleware',
'microsite_configuration.middleware.MicrositeMiddleware',
'django_comment_client.middleware.AjaxExceptionMiddleware',
'django.middleware.common.CommonMiddleware',

View File

@@ -10,12 +10,12 @@ from django.http import (
HttpResponseBadRequest, HttpResponseNotFound, HttpResponsePermanentRedirect)
from student.models import CourseEnrollment
from header_control import force_header_for_response
from xmodule.assetstore.assetmgr import AssetManager
from xmodule.contentstore.content import StaticContent, XASSET_LOCATION_TAG
from xmodule.modulestore import InvalidLocationError
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locator import AssetLocator
from openedx.core.djangoapps.header_control import force_header_for_response
from .caching import get_cached_content, set_cached_content
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.exceptions import NotFoundError

View File

@@ -3,7 +3,7 @@ Middleware decorator for removing headers.
"""
from functools import wraps
from header_control import remove_headers_from_response, force_header_for_response
from openedx.core.djangoapps.header_control import remove_headers_from_response, force_header_for_response
def remove_headers(*headers):

View File

@@ -1,7 +1,8 @@
"""Tests for remove_headers and force_header decorator. """
from django.http import HttpResponse, HttpRequest
from django.test import TestCase
from header_control.decorators import remove_headers, force_header
from openedx.core.djangoapps.header_control.decorators import remove_headers, force_header
def fake_view(_request):

View File

@@ -1,8 +1,9 @@
"""Tests for header_control middleware."""
from django.http import HttpResponse, HttpRequest
from django.test import TestCase
from header_control import remove_headers_from_response, force_header_for_response
from header_control.middleware import HeaderControlMiddleware
from openedx.core.djangoapps.header_control import remove_headers_from_response, force_header_for_response
from openedx.core.djangoapps.header_control.middleware import HeaderControlMiddleware
class TestHeaderControlMiddlewareProcessResponse(TestCase):