def assertAssetWorks(self, asset):
     # Does the path exist?
     name = default_asset_cache.get_name(asset)
     self.assertTrue(default_storage.exists(name))
     # Is the name different?
     self.assertNotEqual(name, asset.get_name())
     # Has the asset been copied successfully?
     self.assertEqual(hashlib.sha1(staticfiles_storage.open(asset.get_name()).read()).hexdigest(), hashlib.sha1(default_storage.open(name).read()).hexdigest())
 def testStaticAsset(self):
     asset = get_test_asset()
     self.assertAssetWorks(asset, staticfiles_storage.open(asset.get_name()))