From 9910d1ecf020db9100bf197d80a86ed5c8062993 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Fri, 26 Jun 2020 15:37:21 +0000 Subject: [PATCH] Added the use of local test directories instead of default settings for bluesheet files in the bluesheet upload API test. - Legacy-Id: 18069 --- ietf/api/tests.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ietf/api/tests.py b/ietf/api/tests.py index 718f82fa6..983226962 100644 --- a/ietf/api/tests.py +++ b/ietf/api/tests.py @@ -4,6 +4,7 @@ import json import os +import shutil import sys from importlib import import_module @@ -35,6 +36,14 @@ OMITTED_APPS = ( ) class CustomApiTests(TestCase): + def setUp(self): + self.agenda_path = self.tempdir('materials') + self.saved_agenda_path = settings.AGENDA_PATH + settings.AGENDA_PATH = self.agenda_path + + def tearDown(self): + shutil.rmtree(self.agenda_path) + settings.AGENDA_PATH = self.saved_agenda_path # Using mock to patch the import functions in ietf.meeting.views, where # api_import_recordings() are using them: @@ -213,7 +222,6 @@ class CustomApiTests(TestCase): r = self.client.post(url, {'apikey': apikey.hash(), 'meeting': meeting.number, 'group': group.acronym, 'item': '1', 'bluesheet': bluesheet, }) - debug.show('bluesheet') self.assertContains(r, "Done", status_code=200) bluesheet = session.sessionpresentation_set.filter(document__type__slug='bluesheets').first().document