From 83e96ee99b6cd8ce1863dcca24dfbf4a8d6b5429 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 12 Jun 2014 13:08:27 -0400 Subject: [PATCH] [1.7.x] Fixed a staticfiles test on Windows. Backport of 9980f67154 from master --- tests/staticfiles_tests/tests.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/staticfiles_tests/tests.py b/tests/staticfiles_tests/tests.py index 764ffcf48c..3dd333c5ea 100644 --- a/tests/staticfiles_tests/tests.py +++ b/tests/staticfiles_tests/tests.py @@ -683,16 +683,17 @@ class TestCollectionManifestStorage(TestHashedFiles, BaseCollectionTestCase, self.assertEqual(hashed_files, manifest) def test_clear_empties_manifest(self): + cleared_file_name = os.path.join('test', 'cleared.txt') # collect the additional file self.run_collectstatic() 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() - 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)) # delete the original file form the app, collect with clear @@ -702,10 +703,10 @@ class TestCollectionManifestStorage(TestHashedFiles, BaseCollectionTestCase, self.assertFileNotFound(original_path) 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() - 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