              lambda s: s.replace(':', ''),
          )
          self.assertEqual(value, signer.unsign(signed_value))
          for transform in transforms:
              self.assertRaises(
                  signing.BadSignature, signer.unsign, transform(signed_value))
  
      def test_dumps_loads(self):
          "dumps and loads be reversible for any JSON serializable object"
          objects = [
              ['a', 'list'],
 
</s> remove             self.assertRaises(
                signing.BadSignature, signing.loads, transform(encoded))
 </s> add             with self.assertRaises(signing.BadSignature):
                signing.loads(transform(encoded)) </s> remove         self.assertRaises(
            TypeError,
            Article.objects.dates,
        )
 </s> add         with self.assertRaises(TypeError):
            Article.objects.dates() </s> remove         self.assertRaises(
            FieldError,
            lambda: Book.objects.all().aggregate(num_authors=Count('foo'))
        )
 </s> add         with self.assertRaises(FieldError):
            Book.objects.all().aggregate(num_authors=Count('foo')) </s> remove         self.assertRaises(
            FieldError,
            lambda: Book.objects.annotate(mean_age=Avg('authors__age')).annotate(Avg('mean_age'))
        )
 </s> add         with self.assertRaises(FieldError):
            Book.objects.annotate(mean_age=Avg('authors__age')).annotate(Avg('mean_age')) </s> remove         self.assertRaises(
            Place.MultipleObjectsReturned,
            Restaurant.objects.get, id__lt=12321
        )
 </s> add         with self.assertRaises(Place.MultipleObjectsReturned):
            Restaurant.objects.get(id__lt=12321)
            with self.assertRaises(signing.BadSignature):
                signer.unsign(transform(signed_value))
              lambda s: s.replace(':', ''),
          )
          self.assertEqual(value, signer.unsign(signed_value))
          for transform in transforms:
            with self.assertRaises(signing.BadSignature):
                signer.unsign(transform(signed_value))
            with self.assertRaises(signing.BadSignature):
                signer.unsign(transform(signed_value))
  
      def test_dumps_loads(self):
          "dumps and loads be reversible for any JSON serializable object"
          objects = [
              ['a', 'list'],
keep keep keep keep replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/signing/tests.py