          for args, kwargs, digest in tests:
              with self.subTest(args=args, kwargs=kwargs):
                  self.assertEqual(salted_hmac(*args, **kwargs).hexdigest(), digest)
  
  
  class TestUtilsCryptoPBKDF2(unittest.TestCase):
  
      # http://tools.ietf.org/html/draft-josefsson-pbkdf2-test-vectors-06
      rfc_vectors = [
          {
 
</s> remove     # passing the key_salt and our base key through a pseudo-random function and
    # SHA1 works nicely.
    key = hashlib.sha1(key_salt + secret).digest()
 </s> add     # passing the key_salt and our base key through a pseudo-random function.
    key = hasher(key_salt + secret).digest() </s> remove class TestUtilsCryptoMisc(unittest.TestCase):
 </s> add class TestUtilsCryptoMisc(SimpleTestCase): </s> remove     return hmac.new(key, msg=force_bytes(value), digestmod=hashlib.sha1)
 </s> add     return hmac.new(key, msg=force_bytes(value), digestmod=hasher) </s> remove 
 </s> add     try:
        hasher = getattr(hashlib, algorithm)
    except AttributeError as e:
        raise InvalidAlgorithm(
            '%r is not an algorithm accepted by the hashlib module.'
            % algorithm
        ) from e
    def test_invalid_algorithm(self):
        msg = "'whatever' is not an algorithm accepted by the hashlib module."
        with self.assertRaisesMessage(InvalidAlgorithm, msg):
            salted_hmac('salt', 'value', algorithm='whatever')

          for args, kwargs, digest in tests:
              with self.subTest(args=args, kwargs=kwargs):
                  self.assertEqual(salted_hmac(*args, **kwargs).hexdigest(), digest)
  
    def test_invalid_algorithm(self):
        msg = "'whatever' is not an algorithm accepted by the hashlib module."
        with self.assertRaisesMessage(InvalidAlgorithm, msg):
            salted_hmac('salt', 'value', algorithm='whatever')

  
  class TestUtilsCryptoPBKDF2(unittest.TestCase):
  
      # http://tools.ietf.org/html/draft-josefsson-pbkdf2-test-vectors-06
      rfc_vectors = [
          {
keep keep keep add keep keep keep keep keep keep
 Refs #27468 -- Added algorithm parameter to django.utils.crypto.salted_hmac(). 
tests/utils_tests/test_crypto.py