  
          with freeze_time(123456800):
              self.assertEqual(request.get_signed_cookie('c', max_age=12), value)
              self.assertEqual(request.get_signed_cookie('c', max_age=11), value)
              self.assertRaises(signing.SignatureExpired,
                  request.get_signed_cookie, 'c', max_age=10)
  
      @override_settings(SECRET_KEY=b'\xe7')
      def test_signed_cookies_with_binary_key(self):
          response = HttpResponse()
          response.set_signed_cookie('c', 'hello')
 
</s> remove             self.assertRaises(signing.SignatureExpired, signer.unsign, ts, max_age=10)
 </s> add             with self.assertRaises(signing.SignatureExpired):
                signer.unsign(ts, max_age=10) </s> remove         self.assertRaises(signing.BadSignature,
            request.get_signed_cookie, 'c')
 </s> add         with self.assertRaises(signing.BadSignature):
            request.get_signed_cookie('c') </s> remove         self.assertRaises(signing.BadSignature,
            request.get_signed_cookie, 'a', salt='two')
 </s> add         with self.assertRaises(signing.BadSignature):
            request.get_signed_cookie('a', salt='two') </s> remove         self.assertRaises(ContentNotRenderedError, lambda: response.content)
 </s> add         with self.assertRaises(ContentNotRenderedError):
            response.content </s> remove         self.assertRaises(PermissionDenied, a_view, request)
 </s> add         with self.assertRaises(PermissionDenied):
            a_view(request)
            with self.assertRaises(signing.SignatureExpired):
                request.get_signed_cookie('c', max_age=10)
  
          with freeze_time(123456800):
              self.assertEqual(request.get_signed_cookie('c', max_age=12), value)
              self.assertEqual(request.get_signed_cookie('c', max_age=11), value)
            with self.assertRaises(signing.SignatureExpired):
                request.get_signed_cookie('c', max_age=10)
            with self.assertRaises(signing.SignatureExpired):
                request.get_signed_cookie('c', max_age=10)
  
      @override_settings(SECRET_KEY=b'\xe7')
      def test_signed_cookies_with_binary_key(self):
          response = HttpResponse()
          response.set_signed_cookie('c', 'hello')
keep keep keep keep replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/signed_cookies_tests/tests.py