Skip to content

Commit 183b304

Browse files
committed
fix failing test
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent 62310e9 commit 183b304

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

product_portfolio/tests/test_views.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4324,17 +4324,17 @@ def test_stale_rule_type_filtered_from_context(self):
43244324
response = self.client.get(url)
43254325
self.assertEqual(0, response.context["policy_violation_count"])
43264326

4327-
def test_all_rules_context_reflects_active_status(self):
4327+
def test_all_rules_context_only_includes_active_rules(self):
43284328
DataspaceConfiguration.objects.create(
43294329
dataspace=self.dataspace,
43304330
policy_rules_config={"usage_policy_error": {"is_active": True}},
43314331
)
43324332
self.client.login(username="nexb_user", password="secret")
43334333
url = self.product1.get_url("tab_compliance")
43344334
response = self.client.get(url)
4335-
all_rules = {rule["rule_type"]: rule for rule in response.context["all_rules"]}
4336-
self.assertTrue(all_rules["usage_policy_error"]["is_active"])
4337-
self.assertFalse(all_rules["license_coverage_gap"]["is_active"])
4335+
rule_types = [rule["rule_type"] for rule in response.context["all_rules"]]
4336+
self.assertIn("usage_policy_error", rule_types)
4337+
self.assertNotIn("license_coverage_gap", rule_types)
43384338

43394339

43404340
class ComplianceDashboardPolicyViolationsTestCase(TestCase):

0 commit comments

Comments
 (0)