Exemple #1
0
 def test_cache_key_memcache_validation(self):
     """
     Handle cache key creation correctly, see #17861.
     """
     name = b"/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/" + chr(22) + chr(180)
     cache_key = storage.staticfiles_storage.cache_key(name)
     cache_validator = BaseCache({})
     cache_validator.validate_key(cache_key)
     self.assertEqual(cache_key, 'staticfiles:e95bbc36387084582df2a70750d7b351')
Exemple #2
0
 def test_cache_key_memcache_validation(self):
     """
     Handle cache key creation correctly, see #17861.
     """
     name = "/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/" + "\x16" + "\xb4"
     cache_key = storage.staticfiles_storage.cache_key(name)
     cache_validator = BaseCache({})
     cache_validator.validate_key(cache_key)
     self.assertEqual(cache_key, 'staticfiles:821ea71ef36f95b3922a77f7364670e7')
Exemple #3
0
 def test_cache_key_memcache_validation(self):
     """
     Handle cache key creation correctly, see #17861.
     """
     name = "/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/" + "\x16" + "\xb4"
     cache_key = storage.staticfiles_storage.hash_key(name)
     cache_validator = BaseCache({})
     cache_validator.validate_key(cache_key)
     self.assertEqual(cache_key, 'staticfiles:821ea71ef36f95b3922a77f7364670e7')
Exemple #4
0
 def test_cache_key_memcache_validation(self):
     """
     Handle cache key creation correctly, see #17861.
     """
     name = b"/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/" + chr(22) + chr(180)
     cache_key = storage.staticfiles_storage.cache_key(name)
     cache_validator = BaseCache({})
     cache_validator.validate_key(cache_key)
     self.assertEqual(cache_key, 'staticfiles:e95bbc36387084582df2a70750d7b351')
Exemple #5
0
 def test_cache_key_memcache_validation(self):
     """
     Handle cache key creation correctly, see #17861.
     """
     name = "/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/" + chr(22) + chr(180)
     cache_key = storage.staticfiles_storage.cache_key(name)
     self.save_warnings_state()
     cache_validator = BaseCache({})
     warnings.filterwarnings('error', category=CacheKeyWarning)
     cache_validator.validate_key(cache_key)
     self.restore_warnings_state()
     self.assertEqual(cache_key, 'staticfiles:e95bbc36387084582df2a70750d7b351')
Exemple #6
0
 def test_cache_key_memcache_validation(self):
     """
     Handle cache key creation correctly, see #17861.
     """
     name = "/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/long filename/ with spaces Here and ?#%#$/other/stuff/some crazy/" + chr(22) + chr(180)
     cache_key = storage.staticfiles_storage.cache_key(name)
     self.save_warnings_state()
     cache_validator = BaseCache({})
     warnings.filterwarnings('error', category=CacheKeyWarning)
     cache_validator.validate_key(cache_key)
     self.restore_warnings_state()
     self.assertEqual(cache_key, 'staticfiles:e95bbc36387084582df2a70750d7b351')