'Ensures @xframe_options_exempt properly instructs the
XFrameOptionsMiddleware to NOT set the header.'

def test_exempt_decorator(self):

    @xframe_options_exempt
    def a_view(request):
        return HttpResponse()
    req = HttpRequest()
    resp = a_view(req)
    self.assertEqual(resp.get('X-Frame-Options', None), None)
    self.assertTrue(resp.xframe_options_exempt)
    r = XFrameOptionsMiddleware().process_response(req, resp)
    self.assertEqual(r.get('X-Frame-Options', None), None)
