'Ensure headers sent by the default MIDDLEWARE don\'t inadvertently
change. For example, we never want "Vary: Cookie" to appear in the list
since it prevents the caching of responses.'

def test_middleware_headers(self):

    with extend_sys_path(self.temp_dir.name):
        from test_settings import MIDDLEWARE
    with self.settings(MIDDLEWARE=MIDDLEWARE, ROOT_URLCONF='project_template.urls'):
        response = self.client.get('/empty/')
        headers = sorted(response.serialize_headers().split('\r\n'))
        self.assertEqual(headers, ['Content-Length:    0', 'Content-Type:    text/html;    charset=utf-8', 'X-Frame-Options:    SAMEORIGIN'])
