File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from django .test import Client
22from django .test import TestCase
33
4+ from vulnerabilities .models import Alias
45from vulnerabilities .models import Vulnerability
56
67
@@ -26,6 +27,8 @@ class VulnerabilitySearchTestCase(TestCase):
2627 def setUp (self ):
2728 vulnerability = Vulnerability (summary = "test" )
2829 vulnerability .save ()
30+ alias = Alias (alias = "TEST-2022" , vulnerability = vulnerability )
31+ alias .save ()
2932 self .id = vulnerability .id
3033 self .client = Client ()
3134
@@ -36,9 +39,16 @@ def test_vulnerabilties(self):
3639 response = self .client .get (f"/vulnerabilities/{ self .id } " )
3740 self .assertEqual (response .status_code , 200 )
3841
39- def test_vulnerabilties (self ):
42+ def test_vulnerabilties_search (self ):
4043 """
4144 Test Vulnerability Search View
4245 """
4346 response = self .client .get (f"/vulnerabilities/search" )
4447 self .assertEqual (response .status_code , 200 )
48+
49+ def test_alias (self ):
50+ """
51+ Test Vulnerability Search View
52+ """
53+ response = self .client .get (f"/vulnerabilities/search?vuln_id=TEST-2022" )
54+ self .assertEqual (response .status_code , 200 )
You can’t perform that action at this time.
0 commit comments