From 660dd29f03a72494724bde186610ec67a202a232 Mon Sep 17 00:00:00 2001 From: Federico Capoano Date: Wed, 9 May 2018 14:57:27 +0200 Subject: [PATCH] [test] Removed duplication of definition of floorplan test file --- django_loci/tests/base/test_admin_inline.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/django_loci/tests/base/test_admin_inline.py b/django_loci/tests/base/test_admin_inline.py index 5ee83b3..d0381f7 100644 --- a/django_loci/tests/base/test_admin_inline.py +++ b/django_loci/tests/base/test_admin_inline.py @@ -1,6 +1,3 @@ -import os - -from django.conf import settings from django.contrib.gis.geos import GEOSGeometry from django.db.models.fields.files import ImageFieldFile from django.urls import reverse @@ -182,7 +179,7 @@ def test_add_indoor_new_location_new_floorplan(self): self._login_as_admin() p = self._get_prefix() params = self.params - floorplan_file = open(os.path.join(settings.BASE_DIR, 'media/floorplan.jpg'), 'rb') + floorplan_file = open(self._floorplan_path, 'rb') params.update({ 'name': 'test-add-indoor-new-location-new-floorplan', '{0}-0-type'.format(p): 'indoor', @@ -216,7 +213,7 @@ def test_add_indoor_existing_location_new_floorplan(self): pre_loc = self._create_location(type='indoor') p = self._get_prefix() params = self.params - floorplan_file = open(os.path.join(settings.BASE_DIR, 'media/floorplan.jpg'), 'rb') + floorplan_file = open(self._floorplan_path, 'rb') name = 'test-add-indoor-existing-location-new-floorplan' params.update({ 'name': name, @@ -305,7 +302,7 @@ def test_change_indoor(self): self.assertContains(r, obj.name) # -- post changes params = self.params - floorplan_file = open(os.path.join(settings.BASE_DIR, 'media/floorplan.jpg'), 'rb') + floorplan_file = open(self._floorplan_path, 'rb') changed_name = '{0} changed'.format(pre_loc.name) params.update({ 'name': obj.name,