      for char in key:
          if ord(char) < 33 or ord(char) == 127:
              yield (
                  'Cache key contains characters that will cause errors if '
                  'used with memcached: %r' % key, CacheKeyWarning
              )
              break
 
</s> remove * ...
 </s> add * Fixed messages of ``InvalidCacheKey`` exceptions and ``CacheKeyWarning``
  warnings raised by cache key validation (:ticket:`31654`). </s> remove         with self.assertRaisesMessage(InvalidCacheKey, msg):
 </s> add         with self.assertRaises(InvalidCacheKey) as cm: </s> remove             with self.assertWarnsMessage(CacheKeyWarning, expected_warning):
 </s> add             with self.assertWarns(CacheKeyWarning) as cm:
                'used with memcached: %r' % key
      for char in key:
          if ord(char) < 33 or ord(char) == 127:
              yield (
                  'Cache key contains characters that will cause errors if '
                'used with memcached: %r' % key
              )
              break
keep keep keep keep replace keep keep
 Fixed #31654 -- Fixed cache key validation messages. 
django/core/cache/backends/base.py