From bd322a0ce63e1d373e3b65b8435c4dbab62c175a Mon Sep 17 00:00:00 2001 From: Jonas Winkler Date: Tue, 17 Nov 2020 18:35:45 +0100 Subject: [PATCH] fixed test case. --- src/documents/tests/test_consumer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/documents/tests/test_consumer.py b/src/documents/tests/test_consumer.py index a08e492f8..52cf7dcc6 100644 --- a/src/documents/tests/test_consumer.py +++ b/src/documents/tests/test_consumer.py @@ -450,12 +450,14 @@ class TestConsumer(TestCase): def setUp(self): self.scratch_dir = tempfile.mkdtemp() self.media_dir = tempfile.mkdtemp() + self.consumption_dir = tempfile.mkdtemp() override_settings( SCRATCH_DIR=self.scratch_dir, MEDIA_ROOT=self.media_dir, ORIGINALS_DIR=os.path.join(self.media_dir, "documents", "originals"), - THUMBNAIL_DIR=os.path.join(self.media_dir, "documents", "thumbnails") + THUMBNAIL_DIR=os.path.join(self.media_dir, "documents", "thumbnails"), + CONSUMPTION_DIR=self.consumption_dir ).enable() patcher = mock.patch("documents.parsers.document_consumer_declaration.send") @@ -473,6 +475,7 @@ class TestConsumer(TestCase): def tearDown(self): shutil.rmtree(self.scratch_dir, ignore_errors=True) shutil.rmtree(self.media_dir, ignore_errors=True) + shutil.rmtree(self.consumption_dir, ignore_errors=True) def get_test_file(self): fd, f = tempfile.mkstemp(suffix=".pdf", dir=self.scratch_dir)