1515
1616
1717@pytest .fixture
18- def deduplicated_set (deduplication_set : DeduplicationSet ) -> DeduplicationSet :
19- deduplication_set .state = DeduplicationSet .State .DEDUPLICATED
18+ def deduplicated_set (
19+ request : pytest .FixtureRequest ,
20+ deduplication_set : DeduplicationSet ,
21+ ) -> DeduplicationSet :
22+ deduplication_set .state = getattr (
23+ request ,
24+ "param" ,
25+ DeduplicationSet .State .DEDUPLICATED ,
26+ )
2027 deduplication_set .save (update_fields = ["state" ])
2128 return deduplication_set
2229
@@ -25,6 +32,14 @@ def findings_url(deduplication_set_pk: str) -> str:
2532 return reverse (FINDINGS_VIEW , kwargs = {"deduplication_set_pk" : deduplication_set_pk })
2633
2734
35+ @pytest .mark .parametrize (
36+ "deduplicated_set" ,
37+ [
38+ DeduplicationSet .State .DEDUPLICATED ,
39+ DeduplicationSet .State .APPROVED ,
40+ ],
41+ indirect = True ,
42+ )
2843def test_can_list_duplicates (api_client : APIClient , deduplicated_set : DeduplicationSet , finding : Finding ) -> None :
2944 response = api_client .get (findings_url (deduplicated_set .pk ))
3045 assert response .status_code == status .HTTP_200_OK
@@ -33,7 +48,7 @@ def test_can_list_duplicates(api_client: APIClient, deduplicated_set: Deduplicat
3348 assert "config" in data ["results" ][0 ]
3449
3550
36- def test_findings_only_visible_when_deduplicated (
51+ def test_findings_only_visible_when_deduplicated_or_approved (
3752 api_client : APIClient , deduplication_set : DeduplicationSet , finding : Finding
3853) -> None :
3954 response = api_client .get (findings_url (deduplication_set .pk ))
0 commit comments