From 35e09e476d51fc594c16bf651ea4cfb2ce7f5419 Mon Sep 17 00:00:00 2001 From: Thomas Druez Date: Tue, 17 Nov 2020 18:02:09 +0400 Subject: [PATCH] Removethe project name in the CSV outputs #45 Signed-off-by: Thomas Druez --- scanpipe/pipes/outputs.py | 2 +- scanpipe/tests/test_pipes.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scanpipe/pipes/outputs.py b/scanpipe/pipes/outputs.py index 8c96b0b6e..b416dbd91 100644 --- a/scanpipe/pipes/outputs.py +++ b/scanpipe/pipes/outputs.py @@ -40,7 +40,7 @@ def queryset_to_csv(project, queryset, fieldnames): The output file is created in the `project` output/ directory. """ model_name = queryset.model._meta.model_name - output_file = project.get_output_file_path(f"{project.name}_{model_name}", "csv") + output_file = project.get_output_file_path(f"{model_name}", "csv") with open(output_file, "w") as csvfile: writer = csv.DictWriter(csvfile, fieldnames) diff --git a/scanpipe/tests/test_pipes.py b/scanpipe/tests/test_pipes.py index f9468d9e3..d96e851bd 100644 --- a/scanpipe/tests/test_pipes.py +++ b/scanpipe/tests/test_pipes.py @@ -90,8 +90,8 @@ def test_scanpipe_pipes_outputs_to_csv(self): project1 = Project.objects.create(name="Analysis") outputs.to_csv(project=project1) expected = [ - "Analysis_codebaseresource-2010-10-10-10-10-10.csv", - "Analysis_discoveredpackage-2010-10-10-10-10-10.csv", + "codebaseresource-2010-10-10-10-10-10.csv", + "discoveredpackage-2010-10-10-10-10-10.csv", ] self.assertEqual(sorted(expected), sorted(project1.output_root))