Exemple #1
0
    def test_requestProcessing(self):
        """
        Ensure that the middleware assigns a Referrer-Policy header to the response object
        """

        referrer_middleware = ReferrerMiddleware(MagicMock())
        response = referrer_middleware(MagicMock())
        response.__setitem__.assert_called_with('Referrer-Policy',
                                                'same-origin')
Exemple #2
0
 def setUp(self):
     referrer_middleware = ReferrerMiddleware('response')
     self.assertEqual(referrer_middleware.get_response, 'response')