From 18333563f20a1770166fa173d991bb6910ef86b4 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sat, 22 May 2021 12:03:37 +0200 Subject: [PATCH] WIP fixing path issues on diffrent systems relative paths do not appear to work on windows or at least the setup i have --- cookbook/tests/other/test_url_import.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cookbook/tests/other/test_url_import.py b/cookbook/tests/other/test_url_import.py index 3c7f2a80..bf038869 100644 --- a/cookbook/tests/other/test_url_import.py +++ b/cookbook/tests/other/test_url_import.py @@ -1,4 +1,6 @@ import json +import os + import pytest from django.urls import reverse @@ -51,7 +53,8 @@ def test_import_permission(arg, request): ]) def test_recipe_import(arg, u1_s1): for f in arg['file']: - with open(DATA_DIR + f, 'r', encoding='UTF-8') as d: + test_file = os.path.join(os.getenv('PYTEST_CURRENT_TEST').split('test_url_import.py')[0], 'test_data', f) + with open(test_file, 'r', encoding='UTF-8') as d: response = u1_s1.post( reverse(IMPORT_SOURCE_URL), {