          with freeze_time(123456800):
              self.assertEqual(signer.unsign(ts, max_age=12), value)
              # max_age parameter can also accept a datetime.timedelta object
              self.assertEqual(signer.unsign(ts, max_age=datetime.timedelta(seconds=11)), value)
              self.assertRaises(signing.SignatureExpired, signer.unsign, ts, max_age=10)
 
</s> remove             self.assertRaises(signing.SignatureExpired,
                request.get_signed_cookie, 'c', max_age=10)
 </s> add             with self.assertRaises(signing.SignatureExpired):
                request.get_signed_cookie('c', max_age=10) </s> remove         self.assertRaises(forms.ValidationError, f.clean, '2010-12-21 13:30:05')
 </s> add         with self.assertRaises(forms.ValidationError):
            f.clean('2010-12-21 13:30:05') </s> remove         self.assertRaises(Site.DoesNotExist, Site.objects.get_current)
 </s> add         with self.assertRaises(Site.DoesNotExist):
            Site.objects.get_current() </s> remove         self.assertRaises(forms.ValidationError, f.clean, '2010-12-21 13:30:05')
 </s> add         with self.assertRaises(forms.ValidationError):
            f.clean('2010-12-21 13:30:05') </s> remove         self.assertRaises(
            Place.DoesNotExist,
            ItalianRestaurant.objects.get, name="The Noodle Void"
        )
 </s> add         with self.assertRaises(Place.DoesNotExist):
            ItalianRestaurant.objects.get(name="The Noodle Void")
            with self.assertRaises(signing.SignatureExpired):
                signer.unsign(ts, max_age=10)
          with freeze_time(123456800):
              self.assertEqual(signer.unsign(ts, max_age=12), value)
              # max_age parameter can also accept a datetime.timedelta object
              self.assertEqual(signer.unsign(ts, max_age=datetime.timedelta(seconds=11)), value)
            with self.assertRaises(signing.SignatureExpired):
                signer.unsign(ts, max_age=10)
keep keep keep keep replace
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/signing/tests.py