From bf2ba1c61bbb51ffcea7035b4396846e9459206d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 29 Jun 2020 16:16:49 +0200 Subject: Fix Ishtar bg deletion on test --- archaeological_finds/tests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'archaeological_finds/tests.py') diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index 9387840a0..2360d4ca6 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -22,6 +22,7 @@ import csv import datetime import json import os +import shutil import tempfile from rest_framework.test import APITestCase @@ -1924,8 +1925,11 @@ class TreatmentTest(FindInit, TestCase): model = models.Find def setUp(self): - img = settings.ROOT_PATH + \ + base_img = settings.ROOT_PATH + \ '../ishtar_common/static/media/images/ishtar-bg.jpg' + temp_dir = tempfile.gettempdir() + img = os.path.join(temp_dir, 'ishtar-bg.jpg') + shutil.copy2(base_img, img) self.create_finds(data_base={"label": u"Find 1"}, force=True) self.create_finds(data_base={"label": u"Find 2"}, force=True) -- cgit v1.2.3