MCPcopy Create free account
hub / github.com/aboutcode-org/vulnerablecode / setUp

Method setUp

vulnerabilities/tests/test_models.py:613–625  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

611
612class TestAdvisoryModel(DjangoTestCase):
613 def setUp(self):
614 self.advisory_data1 = AdvisoryData(
615 summary="vulnerability description here",
616 affected_packages=[
617 AffectedPackage(
618 package=PackageURL(type="pypi", name="dummy"),
619 affected_version_range=VersionRange.from_string("vers:pypi/>=1.0.0|<=2.0.0"),
620 )
621 ],
622 references=[Reference(url="https://example.com/with/more/info/CVE-2020-13371337")],
623 date_published=datetime.now(),
624 url="https://test.com",
625 )
626
627 def test_advisory_insert_without_content_id(self):
628 with self.assertRaises(ValidationError):

Callers

nothing calls this directly

Calls 3

AdvisoryDataClass · 0.90
AffectedPackageClass · 0.90
ReferenceClass · 0.90

Tested by

no test coverage detected