From 92086622ca2398ffad0098d42fa322d32138f27a Mon Sep 17 00:00:00 2001 From: kiblik <5609770+kiblik@users.noreply.github.com> Date: Tue, 18 Jun 2024 00:54:46 +0200 Subject: [PATCH] Try to use SerializeMixin --- requirements.txt | 2 +- unittests/test_apiv2_scan_import_options.py | 3 ++- unittests/test_importers_importer.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index c5937c3be4..c80df9d6ce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -79,4 +79,4 @@ boto3==1.34.126 # Required for Celery Broker AWS (SQS) support netaddr==1.3.0 vulners==2.1.7 fontawesomefree==6.5.1 -tblib==3.0.0 \ No newline at end of file +tblib==3.0.0 diff --git a/unittests/test_apiv2_scan_import_options.py b/unittests/test_apiv2_scan_import_options.py index 78200e48fd..c3101b64f5 100644 --- a/unittests/test_apiv2_scan_import_options.py +++ b/unittests/test_apiv2_scan_import_options.py @@ -1,4 +1,5 @@ from django.core.files.uploadedfile import SimpleUploadedFile +from django.test.testcases import SerializeMixin from django.urls import reverse from rest_framework.authtoken.models import Token from rest_framework.test import APIClient, APITestCase @@ -6,7 +7,7 @@ from dojo.models import Finding, Test, Test_Type -class ScanImportOptionsTest(APITestCase): +class ScanImportOptionsTest(SerializeMixin, APITestCase): """ Test the options `skip_duplicates` and `close_old_findings` for the scan import APIv2 endpoint with ZAP diff --git a/unittests/test_importers_importer.py b/unittests/test_importers_importer.py index 0d26c5b0e8..fe676ca757 100644 --- a/unittests/test_importers_importer.py +++ b/unittests/test_importers_importer.py @@ -2,6 +2,7 @@ import uuid from unittest.mock import patch +from django.test.testcases import SerializeMixin from django.utils import timezone from rest_framework.authtoken.models import Token from rest_framework.test import APIClient @@ -516,7 +517,7 @@ def test_reimport_with_invalid_parameters(self): self.assertEqual(import0, ['product_name parameter missing']) -class TestImporterUtils(DojoAPITestCase): +class TestImporterUtils(SerializeMixin, DojoAPITestCase): def setUp(self): self.testuser, _ = User.objects.get_or_create(username="admin", is_superuser=True) token, _ = Token.objects.get_or_create(user=self.testuser)