@@ -34,13 +34,14 @@ class TestVulnerabilityModel(TestCase):
3434
3535 def test_generate_vulcoid_given_timestamp_object (self ):
3636 timestamp_object = datetime (2021 , 1 , 1 , 11 , 12 , 13 , 2000 )
37- expected_vulcoid = "VULCOID-20210101-1112-1300 "
37+ expected_vulcoid = "VULCOID-20210101-1112-13002000 "
3838 found_vulcoid = models .Vulnerability .generate_vulcoid (timestamp_object )
39+ print (found_vulcoid )
3940 assert expected_vulcoid == found_vulcoid
4041
4142 def test_generate_vulcoid (self ):
42- expected_vulcoid = "VULCOID-20210101-1112-1300 "
43- with freeze_time ("2021-01-01 11:12:13.0000 " ):
43+ expected_vulcoid = "VULCOID-20210101-1112-13000000 "
44+ with freeze_time ("2021-01-01 11:12:13.000000 " ):
4445 found_vulcoid = models .Vulnerability .generate_vulcoid ()
4546 assert expected_vulcoid == found_vulcoid
4647
@@ -52,11 +53,11 @@ def test_vulnerability_save_with_vulnerability_id(self):
5253 @pytest .mark .django_db
5354 def test_vulnerability_save_without_vulnerability_id (self ):
5455 assert models .Vulnerability .objects .filter (
55- vulnerability_id = "VULCOID-20210101-1112-1300 "
56+ vulnerability_id = "VULCOID-20210101-1112-13000000 "
5657 ).count () == 0
5758
58- with freeze_time ("2021-01-01 11:12:13.0000 " ):
59+ with freeze_time ("2021-01-01 11:12:13.000000 " ):
5960 models .Vulnerability (vulnerability_id = "" ).save ()
6061 assert models .Vulnerability .objects .filter (
61- vulnerability_id = "VULCOID-20210101-1112-1300 "
62+ vulnerability_id = "VULCOID-20210101-1112-13000000 "
6263 ).count () == 1
0 commit comments