コード例 #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')
コード例 #2
0
ファイル: tests.py プロジェクト: Absherr/django
 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')
コード例 #3
0
ファイル: tests.py プロジェクト: nickhgarrison/django
 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')
コード例 #4
0
ファイル: tests.py プロジェクト: LUMC/django
 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')
コード例 #5
0
ファイル: tests.py プロジェクト: 15580056814/hue
 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')
コード例 #6
0
ファイル: tests.py プロジェクト: gandalfar/django_old
 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')