Added the use of local test directories instead of default settings for bluesheet files in the bluesheet upload API test.

- Legacy-Id: 18069
This commit is contained in:
Henrik Levkowetz 2020-06-26 15:37:21 +00:00
parent 3c1c09c54a
commit 9910d1ecf0

View file

@ -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