diff --git a/vulnerabilities/tests/test_models.py b/vulnerabilities/tests/test_models.py index 8b3115a19..9220c8471 100644 --- a/vulnerabilities/tests/test_models.py +++ b/vulnerabilities/tests/test_models.py @@ -61,6 +61,12 @@ def test_vulnerability_save_without_vulnerability_id(self): == 1 ) + def test_cwe_not_present_in_weaknesses_db(self): + w1 = models.Weakness.objects.create(name="189") + assert w1.weakness is None + assert w1.name is "" + assert w1.description is "" + # FIXME: The fixture code is duplicated. setUpClass is not working with the pytest mark. @pytest.mark.django_db @@ -196,13 +202,6 @@ def test_get_vulnerable_packages(self): assert vuln_packages.count() == 3 assert vuln_packages.distinct().count() == 2 - # matching_fixed_packages = vulnerablecode_package.get_fixed_packages(vulnerablecode_package) - # assert vuln_packages.distinct()[0] - - # matching_fixed_packages = vuln_packages.distinct()[0].get_fixed_packages( - # vuln_packages.distinct()[0] - # ) - first_vulnerable_package = vuln_packages.distinct()[0] matching_fixed_packages = first_vulnerable_package.get_fixed_packages( first_vulnerable_package