Updat test from form renaming
Also handle renaming of vulnd_id to vulnerability_id
from django.test import TestCase
-from vulnerabilities.forms import CVEForm
+from vulnerabilities.forms import VulnerabilityForm
from vulnerabilities.models import Vulnerability
-class TestCVEForm(TestCase):
+class TestVulnerabilityForm(TestCase):
def setUp(self) -> None:
vuln1 = Vulnerability.objects.create(summary="test-vuln1", vulnerability_id="VCID-1234")
self.id = vuln1.id
- def test_cve_form(self):
- form = CVEForm(data={"vuln_id": "vcid-1234"})
+ def test_VulnerabilityForm__is_valid_with_simple_input(self):
+ form = VulnerabilityForm(data={"vulnerability_id": "vcid-1234"})
assert form.is_valid()
- def test_client(self):
+ def test_vulnerabilities_client(self):
response = self.client.get(f"/vulnerabilities/{self.id}?vuln_id=vcid-1234")
self.assertContains(response, "test-vuln1", status_code=200)
