1- import datetime
21from datetime import date
32
43from dojo .models import Test
@@ -20,7 +19,7 @@ def test_parse_file_with_one_finding(self):
2019 finding = findings [0 ]
2120 self .assertEqual ("Medium" , finding .severity )
2221 self .assertEqual (352 , finding .cwe )
23- self .assertEqual (datetime . date (2018 , 9 , 24 ), finding .date )
22+ self .assertEqual (date (2018 , 9 , 24 ), finding .date )
2423 self .assertIsNotNone (finding .description )
2524 self .assertGreater (len (finding .description ), 0 )
2625 self .assertFalse (finding .false_p )
@@ -47,7 +46,7 @@ def test_parse_file_with_multiple_finding(self):
4746 with self .subTest (i = 0 ):
4847 finding = findings [0 ]
4948 self .assertEqual ("Medium" , finding .severity )
50- self .assertEqual (datetime . date (2020 , 2 , 27 ), finding .date )
49+ self .assertEqual (date (2020 , 2 , 27 ), finding .date )
5150 self .assertIsNotNone (finding .description )
5251 self .assertEqual ("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L" , finding .cvssv3 )
5352 self .assertFalse (finding .false_p )
@@ -77,7 +76,7 @@ def test_parse_file_with_multiple_finding(self):
7776 self .assertEqual ("Possible virtual host found" , finding .title )
7877 self .assertEqual ("Low" , finding .severity )
7978 self .assertEqual (200 , finding .cwe )
80- self .assertEqual (datetime . date (2020 , 2 , 27 ), finding .date )
79+ self .assertEqual (date (2020 , 2 , 27 ), finding .date )
8180 self .assertIsNotNone (finding .description )
8281 self .assertEqual ("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N" , finding .cvssv3 )
8382 self .assertFalse (finding .false_p )
@@ -107,7 +106,7 @@ def test_parse_file_with_multiple_finding(self):
107106 self .assertEqual ("Unencrypted connection (verified)" , finding .title )
108107 self .assertEqual ("Low" , finding .severity )
109108 self .assertEqual (310 , finding .cwe )
110- self .assertEqual (datetime . date (2020 , 2 , 27 ), finding .date )
109+ self .assertEqual (date (2020 , 2 , 27 ), finding .date )
111110 self .assertIsNotNone (finding .description )
112111 self .assertEqual ("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N" , finding .cvssv3 )
113112 self .assertFalse (finding .false_p )
@@ -143,7 +142,7 @@ def test_parse_file_with_example_com(self):
143142 finding = findings [0 ]
144143 self .assertEqual ("HTML form without CSRF protection" , finding .title )
145144 self .assertEqual ("Medium" , finding .severity )
146- self .assertEqual (datetime . date (2020 , 4 , 28 ), finding .date )
145+ self .assertEqual (date (2020 , 4 , 28 ), finding .date )
147146 self .assertIsNotNone (finding .description )
148147 self .assertEqual ("CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N" , finding .cvssv3 )
149148 self .assertFalse (finding .false_p )
@@ -179,7 +178,7 @@ def test_parse_file_with_example_com(self):
179178 finding = findings [6 ]
180179 self .assertEqual ("Content Security Policy (CSP) not implemented" , finding .title )
181180 self .assertEqual ("Info" , finding .severity )
182- self .assertEqual (datetime . date (2020 , 4 , 28 ), finding .date )
181+ self .assertEqual (date (2020 , 4 , 28 ), finding .date )
183182 self .assertIsNotNone (finding .description )
184183 self .assertFalse (finding .false_p )
185184 self .assertIn ("CSP can be used to prevent and/or mitigate attacks that involve content/code injection," , finding .impact )
0 commit comments