Skip to content

Commit

Permalink
Add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Maffooch committed Sep 5, 2024
1 parent 7811b78 commit 7971a1c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions unittests/test_import_reimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,24 @@ def test_import_history_reactivated_and_untouched_findings_do_not_mix(self):
self.reimport_scan_with_params(test_id, self.generic_import_1, scan_type=self.scan_type_generic)
# Passing this test means an exception does not occur

def test_dynamic_parsing_field_set_to_true(self):
# Test that a generic finding import creates a new test type
# with the dynamically_generated field set to True
import0 = self.import_scan_with_params(self.generic_import_1, scan_type=self.scan_type_generic)
test_id = import0["test"]
# Fetch the test from the DB to access the test type
test = Test.objects.get(id=test_id)
self.assertTrue(test.test_type.dynamically_generated)

def test_dynamic_parsing_field_set_to_false(self):
# Test that a ZAP import does not create a new test type
# and that the dynamically_generated field set to False
import0 = self.import_scan_with_params(self.zap_sample0_filename)
test_id = import0["test"]
# Fetch the test from the DB to access the test type
test = Test.objects.get(id=test_id)
self.assertFalse(test.test_type.dynamically_generated)


class ImportReimportTestAPI(DojoAPITestCase, ImportReimportMixin):
fixtures = ["dojo_testdata.json"]
Expand Down

0 comments on commit 7971a1c

Please sign in to comment.