@@ -480,14 +480,14 @@ def test_api_packages_single_with_purl_in_query_num_queries(self):
480480 self .csrf_client .get (f"/api/packages/?purl={ self .pkg_2_14_0_rc1 .purl } " , format = "json" )
481481
482482 def test_api_packages_single_with_purl_no_version_in_query_num_queries (self ):
483- with self .assertNumQueries (68 ):
483+ with self .assertNumQueries (64 ):
484484 self .csrf_client .get (
485485 f"/api/packages/?purl=pkg:maven/com.fasterxml.jackson.core/jackson-databind" ,
486486 format = "json" ,
487487 )
488488
489489 def test_api_packages_bulk_search (self ):
490- with self .assertNumQueries (49 ):
490+ with self .assertNumQueries (45 ):
491491 packages = [self .pkg_2_12_6 , self .pkg_2_12_6_1 , self .pkg_2_13_1 ]
492492 purls = [p .purl for p in packages ]
493493
@@ -500,7 +500,7 @@ def test_api_packages_bulk_search(self):
500500 ).json ()
501501
502502 def test_api_packages_with_lookup (self ):
503- with self .assertNumQueries (18 ):
503+ with self .assertNumQueries (14 ):
504504 data = {"purl" : self .pkg_2_12_6 .purl }
505505
506506 resp = self .csrf_client .post (
@@ -510,7 +510,7 @@ def test_api_packages_with_lookup(self):
510510 ).json ()
511511
512512 def test_api_packages_bulk_lookup (self ):
513- with self .assertNumQueries (49 ):
513+ with self .assertNumQueries (45 ):
514514 packages = [self .pkg_2_12_6 , self .pkg_2_12_6_1 , self .pkg_2_13_1 ]
515515 purls = [p .purl for p in packages ]
516516
@@ -562,6 +562,7 @@ def setUp(self):
562562 self .pkg_2_14_0_rc1 = from_purl (
563563 "pkg:maven/com.fasterxml.jackson.core/jackson-databind@2.14.0-rc1"
564564 )
565+ self .pkg_2_12_6 .calculate_version_rank
565566
566567 self .ref = VulnerabilityReference .objects .create (
567568 reference_type = "advisory" , reference_id = "CVE-xxx-xxx" , url = "https://example.com"
0 commit comments