From bd059e3f8c6311dcaf8afe5e29ef373f7f84cf26 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Thu, 5 Feb 2015 21:56:59 +0100 Subject: [PATCH] Removed workaround for SVN limitations. In addition to simplifying the code, this reduces the number of writes. --- .../apps/test/static/test/.hidden | 1 + .../apps/test/static/test/test.ignoreme | 2 +- .../apps/test/static/test/window.png | Bin 207 -> 153 bytes .../apps/test/static/test/⊗.txt | 1 + .../project/documents/test/backup~ | 1 + tests/staticfiles_tests/tests.py | 26 +++--------------- 6 files changed, 8 insertions(+), 23 deletions(-) create mode 100644 tests/staticfiles_tests/apps/test/static/test/.hidden create mode 100644 tests/staticfiles_tests/apps/test/static/test/⊗.txt create mode 100644 tests/staticfiles_tests/project/documents/test/backup~ diff --git a/tests/staticfiles_tests/apps/test/static/test/.hidden b/tests/staticfiles_tests/apps/test/static/test/.hidden new file mode 100644 index 0000000000..a4de8e4b51 --- /dev/null +++ b/tests/staticfiles_tests/apps/test/static/test/.hidden @@ -0,0 +1 @@ +should be ignored diff --git a/tests/staticfiles_tests/apps/test/static/test/test.ignoreme b/tests/staticfiles_tests/apps/test/static/test/test.ignoreme index d7df09c191..cef6c23575 100644 --- a/tests/staticfiles_tests/apps/test/static/test/test.ignoreme +++ b/tests/staticfiles_tests/apps/test/static/test/test.ignoreme @@ -1 +1 @@ -This file should be ignored. \ No newline at end of file +This file should be ignored. diff --git a/tests/staticfiles_tests/apps/test/static/test/window.png b/tests/staticfiles_tests/apps/test/static/test/window.png index ba48325c0a580d4480cb9f76713d5ec9b2c3756a..89738479c02f2ba7406d42d547f8fbff59abbca1 100644 GIT binary patch delta 136 zcmX@lIFoULWIY2A^wj+F0#XT{E{-7;jIHN4@*Ys&ak)6VLCI(CN++{KVfTn%*EB_T zIQ|!nxORK~kFzhhZWL%F91b|pw$fn6t{+l;-kNe#*e;3)_~!B2XxhtczqsMRU#<)K nW-3o2bdD!kioKq<@$4Ul=>Gc3z3IGQJ3U?fT-G@yFg5`Id_6ZE delta 190 zcmV;v073tm0nY)D8Gi-<005~MrIr8y0G3HaK~y-)#no*Nzz_@o(4N2#PVH2*+6Q7ek|0pXxE-G#ZKOaK4?07*qoM6N<$f**2FRR910 diff --git a/tests/staticfiles_tests/apps/test/static/test/⊗.txt b/tests/staticfiles_tests/apps/test/static/test/⊗.txt new file mode 100644 index 0000000000..598ebdd978 --- /dev/null +++ b/tests/staticfiles_tests/apps/test/static/test/⊗.txt @@ -0,0 +1 @@ +⊗ in the app dir diff --git a/tests/staticfiles_tests/project/documents/test/backup~ b/tests/staticfiles_tests/project/documents/test/backup~ new file mode 100644 index 0000000000..a4de8e4b51 --- /dev/null +++ b/tests/staticfiles_tests/project/documents/test/backup~ @@ -0,0 +1 @@ +should be ignored diff --git a/tests/staticfiles_tests/tests.py b/tests/staticfiles_tests/tests.py index fb6fb61ce8..9f5635a8c2 100644 --- a/tests/staticfiles_tests/tests.py +++ b/tests/staticfiles_tests/tests.py @@ -27,6 +27,9 @@ from django.utils.functional import empty from .storage import DummyStorage TEST_ROOT = os.path.dirname(upath(__file__)) + +TESTFILES_PATH = os.path.join(TEST_ROOT, 'apps', 'test', 'static', 'test') + TEST_SETTINGS = { 'DEBUG': True, 'MEDIA_URL': '/media/', @@ -55,27 +58,6 @@ class BaseStaticFilesTestCase(object): """ Test case with a couple utility assertions. """ - def setUp(self): - self.testfiles_path = os.path.join(TEST_ROOT, 'apps', 'test', 'static', 'test') - # To make sure SVN doesn't hangs itself with the non-ASCII characters - # during checkout, we actually create one file dynamically. - self._nonascii_filepath = os.path.join(self.testfiles_path, '\u2297.txt') - with codecs.open(self._nonascii_filepath, 'w', 'utf-8') as f: - f.write("\u2297 in the app dir") - # And also create the magic hidden file to trick the setup.py's - # package data handling. - self._hidden_filepath = os.path.join(self.testfiles_path, '.hidden') - with codecs.open(self._hidden_filepath, 'w', 'utf-8') as f: - f.write("should be ignored") - self._backup_filepath = os.path.join( - TEST_ROOT, 'project', 'documents', 'test', 'backup~') - with codecs.open(self._backup_filepath, 'w', 'utf-8') as f: - f.write("should be ignored") - - def tearDown(self): - os.unlink(self._nonascii_filepath) - os.unlink(self._hidden_filepath) - os.unlink(self._backup_filepath) def assertFileContains(self, filepath, text): self.assertIn(text, self._get_file(force_text(filepath)), @@ -656,7 +638,7 @@ class TestCollectionManifestStorage(TestHashedFiles, BaseCollectionTestCase, def setUp(self): super(TestCollectionManifestStorage, self).setUp() - self._clear_filename = os.path.join(self.testfiles_path, 'cleared.txt') + self._clear_filename = os.path.join(TESTFILES_PATH, 'cleared.txt') with open(self._clear_filename, 'w') as f: f.write('to be deleted in one test')