Skip to content

Commit

Permalink
Move weakness test #1228
Browse files Browse the repository at this point in the history
Reference: #1228

Signed-off-by: John M. Horan <johnmhoran@gmail.com>
  • Loading branch information
johnmhoran committed Nov 22, 2023
1 parent eb69a01 commit 9a9401a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions vulnerabilities/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9a9401a

Please sign in to comment.