@@ -527,14 +527,14 @@ def test_api_packages_single_with_purl_in_query_num_queries(self):
527527 self .csrf_client .get (f"/api/packages/?purl={ self .pkg_2_14_0_rc1 .purl } " , format = "json" )
528528
529529 def test_api_packages_single_with_purl_no_version_in_query_num_queries (self ):
530- with self .assertNumQueries (68 ):
530+ with self .assertNumQueries (64 ):
531531 self .csrf_client .get (
532532 f"/api/packages/?purl=pkg:maven/com.fasterxml.jackson.core/jackson-databind" ,
533533 format = "json" ,
534534 )
535535
536536 def test_api_packages_bulk_search (self ):
537- with self .assertNumQueries (49 ):
537+ with self .assertNumQueries (45 ):
538538 packages = [self .pkg_2_12_6 , self .pkg_2_12_6_1 , self .pkg_2_13_1 ]
539539 purls = [p .purl for p in packages ]
540540
@@ -547,7 +547,7 @@ def test_api_packages_bulk_search(self):
547547 ).json ()
548548
549549 def test_api_packages_with_lookup (self ):
550- with self .assertNumQueries (18 ):
550+ with self .assertNumQueries (14 ):
551551 data = {"purl" : self .pkg_2_12_6 .purl }
552552
553553 resp = self .csrf_client .post (
@@ -557,7 +557,7 @@ def test_api_packages_with_lookup(self):
557557 ).json ()
558558
559559 def test_api_packages_bulk_lookup (self ):
560- with self .assertNumQueries (49 ):
560+ with self .assertNumQueries (45 ):
561561 packages = [self .pkg_2_12_6 , self .pkg_2_12_6_1 , self .pkg_2_13_1 ]
562562 purls = [p .purl for p in packages ]
563563
@@ -609,6 +609,7 @@ def setUp(self):
609609 self .pkg_2_14_0_rc1 = from_purl (
610610 "pkg:maven/com.fasterxml.jackson.core/jackson-databind@2.14.0-rc1"
611611 )
612+ self .pkg_2_12_6 .calculate_version_rank
612613
613614 self .ref = VulnerabilityReference .objects .create (
614615 reference_type = "advisory" , reference_id = "CVE-xxx-xxx" , url = "https://example.com"
0 commit comments