From 6ff06aa73ab42ed59aa6e189100bee5bd3757cc4 Mon Sep 17 00:00:00 2001 From: Malene Lundemo Date: Thu, 3 Apr 2025 15:40:52 +0200 Subject: [PATCH] Delete backend/tests/test_special_value_file_format.py --- .../tests/test_special_value_file_format.py | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 backend/tests/test_special_value_file_format.py diff --git a/backend/tests/test_special_value_file_format.py b/backend/tests/test_special_value_file_format.py deleted file mode 100644 index 9ecf204..0000000 --- a/backend/tests/test_special_value_file_format.py +++ /dev/null @@ -1,29 +0,0 @@ -""" -TC_004 - Special value test for uploading a valid and invalid file to a workout. -""" -from django.test import TestCase - -def test_file_upload_special_value(self): - # Creates a PDF-file - pdf_file = SimpleUploadedFile("pdf_file.pdf") - # Creates a DOCX-file - docx_file = SimpleUploadedFile("docx_file.docx") - # Creates AthleteFile object with the files - athlete_pdf_file = AthleteFile(athlete=self.user, owner=self.user, file=pdf_file) - athlete_docx_file = AthleteFile(athlete=self.user, owner=self.user, file=docx_file) - - try: - # Runs validation check for PDF-file - athlete_pdf_file.full_clean() - except ValidationError as e: - # Fails if any validation errors are raised - self.fail(f"ValidationError raised: {e}") - - try: - # Runs validation check for DOCX-file - athlete_pdf_file.full_clean() - # Fails if no validation errors are raised - self.fail("ValidationError not raised for file of format DOCX.") - except ValidationError as e: - # Passes if validation error is raised. - self.assertIn('file', e.message_dict)