Kaydet (Commit) 9980f671 authored tarafından Tim Graham's avatar Tim Graham

Fixed a staticfiles test on Windows.

üst 26cd1956
...@@ -678,16 +678,17 @@ class TestCollectionManifestStorage(TestHashedFiles, BaseCollectionTestCase, ...@@ -678,16 +678,17 @@ class TestCollectionManifestStorage(TestHashedFiles, BaseCollectionTestCase,
self.assertEqual(hashed_files, manifest) self.assertEqual(hashed_files, manifest)
def test_clear_empties_manifest(self): def test_clear_empties_manifest(self):
cleared_file_name = os.path.join('test', 'cleared.txt')
# collect the additional file # collect the additional file
self.run_collectstatic() self.run_collectstatic()
hashed_files = storage.staticfiles_storage.hashed_files hashed_files = storage.staticfiles_storage.hashed_files
self.assertIn('test/cleared.txt', hashed_files) self.assertIn(cleared_file_name, hashed_files)
manifest_content = storage.staticfiles_storage.load_manifest() manifest_content = storage.staticfiles_storage.load_manifest()
self.assertIn('test/cleared.txt', manifest_content) self.assertIn(cleared_file_name, manifest_content)
original_path = storage.staticfiles_storage.path('test/cleared.txt') original_path = storage.staticfiles_storage.path(cleared_file_name)
self.assertTrue(os.path.exists(original_path)) self.assertTrue(os.path.exists(original_path))
# delete the original file form the app, collect with clear # delete the original file form the app, collect with clear
...@@ -697,10 +698,10 @@ class TestCollectionManifestStorage(TestHashedFiles, BaseCollectionTestCase, ...@@ -697,10 +698,10 @@ class TestCollectionManifestStorage(TestHashedFiles, BaseCollectionTestCase,
self.assertFileNotFound(original_path) self.assertFileNotFound(original_path)
hashed_files = storage.staticfiles_storage.hashed_files hashed_files = storage.staticfiles_storage.hashed_files
self.assertNotIn('test/cleared.txt', hashed_files) self.assertNotIn(cleared_file_name, hashed_files)
manifest_content = storage.staticfiles_storage.load_manifest() manifest_content = storage.staticfiles_storage.load_manifest()
self.assertNotIn('test/cleared.txt', manifest_content) self.assertNotIn(cleared_file_name, manifest_content)
# we set DEBUG to False here since the template tag wouldn't work otherwise # we set DEBUG to False here since the template tag wouldn't work otherwise
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment