@@ -34,13 +34,14 @@ class TestVulnerabilityModel(TestCase):
34
34
35
35
def test_generate_vulcoid_given_timestamp_object (self ):
36
36
timestamp_object = datetime (2021 , 1 , 1 , 11 , 12 , 13 , 2000 )
37
- expected_vulcoid = "VULCOID-20210101-1112-1300 "
37
+ expected_vulcoid = "VULCOID-20210101-1112-13002000 "
38
38
found_vulcoid = models .Vulnerability .generate_vulcoid (timestamp_object )
39
+ print (found_vulcoid )
39
40
assert expected_vulcoid == found_vulcoid
40
41
41
42
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 " ):
44
45
found_vulcoid = models .Vulnerability .generate_vulcoid ()
45
46
assert expected_vulcoid == found_vulcoid
46
47
@@ -52,11 +53,11 @@ def test_vulnerability_save_with_vulnerability_id(self):
52
53
@pytest .mark .django_db
53
54
def test_vulnerability_save_without_vulnerability_id (self ):
54
55
assert models .Vulnerability .objects .filter (
55
- vulnerability_id = "VULCOID-20210101-1112-1300 "
56
+ vulnerability_id = "VULCOID-20210101-1112-13000000 "
56
57
).count () == 0
57
58
58
- with freeze_time ("2021-01-01 11:12:13.0000 " ):
59
+ with freeze_time ("2021-01-01 11:12:13.000000 " ):
59
60
models .Vulnerability (vulnerability_id = "" ).save ()
60
61
assert models .Vulnerability .objects .filter (
61
- vulnerability_id = "VULCOID-20210101-1112-1300 "
62
+ vulnerability_id = "VULCOID-20210101-1112-13000000 "
62
63
).count () == 1
0 commit comments