@@ -556,6 +556,22 @@ def setUp(self):
556556 "pkg:maven/com.fasterxml.jackson.core/[email protected] " 557557 )
558558
559+ self .ref = VulnerabilityReference .objects .create (
560+ reference_type = "advisory" , reference_id = "CVE-xxx-xxx" , url = "https://example.com"
561+ )
562+
563+ self .severity = VulnerabilitySeverity .objects .create (
564+ url = "https://example.com" ,
565+ scoring_system = EPSS .identifier ,
566+ scoring_elements = ".0016" ,
567+ value = "0.526" ,
568+ )
569+ self .vul1 .references .add (self .ref )
570+ self .vul1 .severities .add (self .severity )
571+
572+ self .vul3 .references .add (self .ref )
573+ self .vul3 .severities .add (self .severity )
574+
559575 set_as_fixing (package = self .pkg_2_12_6 , vulnerability = self .vul3 )
560576
561577 set_as_affected_by (package = self .pkg_2_12_6_1 , vulnerability = self .vul2 )
@@ -587,7 +603,21 @@ def test_api_with_lesser_and_greater_fixed_by_packages(self):
587603 "url" : "http://testserver/api/vulnerabilities/{0}" .format (self .vul1 .id ),
588604 "vulnerability_id" : "VCID-vul1-vul1-vul1" ,
589605 "summary" : "This is VCID-vul1-vul1-vul1" ,
590- "references" : [],
606+ "references" : [
607+ {
608+ "reference_url" : "https://example.com" ,
609+ "reference_id" : "CVE-xxx-xxx" ,
610+ "reference_type" : "advisory" ,
611+ "scores" : [
612+ {
613+ "value" : "0.526" ,
614+ "scoring_system" : "epss" ,
615+ "scoring_elements" : ".0016" ,
616+ }
617+ ],
618+ "url" : "https://example.com" ,
619+ }
620+ ],
591621 "fixed_packages" : [
592622 {
593623 "url" : "http://testserver/api/packages/{0}" .format (self .pkg_2_13_2 .id ),
@@ -608,7 +638,21 @@ def test_api_with_lesser_and_greater_fixed_by_packages(self):
608638 "url" : "http://testserver/api/vulnerabilities/{0}" .format (self .vul3 .id ),
609639 "vulnerability_id" : "VCID-vul3-vul3-vul3" ,
610640 "summary" : "This is VCID-vul3-vul3-vul3" ,
611- "references" : [],
641+ "references" : [
642+ {
643+ "reference_url" : "https://example.com" ,
644+ "reference_id" : "CVE-xxx-xxx" ,
645+ "reference_type" : "advisory" ,
646+ "scores" : [
647+ {
648+ "value" : "0.526" ,
649+ "scoring_system" : "epss" ,
650+ "scoring_elements" : ".0016" ,
651+ }
652+ ],
653+ "url" : "https://example.com" ,
654+ }
655+ ],
612656 "fixed_packages" : [
613657 {
614658 "url" : "http://testserver/api/packages/{0}" .format (self .pkg_2_12_6 .id ),
0 commit comments