fix(): fixed bugs with cache invalidation, notifications and guardrails
This commit is contained in:
@@ -349,6 +349,26 @@ class RejectAndReqChangesTest(TestCase):
|
||||
exp = experiment_reopen(experiment=exp, user=self.experimenter)
|
||||
self.assertEqual(exp.status, ExperimentStatus.DRAFT)
|
||||
|
||||
def test_unauthorized_reject_raises(self) -> None:
|
||||
outsider = make_approver("_rr_out")
|
||||
with self.assertRaises(ValidationError) as ctx:
|
||||
experiment_reject(
|
||||
experiment=self.exp,
|
||||
user=outsider,
|
||||
comment="nope",
|
||||
)
|
||||
self.assertIn("user", ctx.exception.message_dict)
|
||||
|
||||
def test_unauthorized_request_changes_raises(self) -> None:
|
||||
outsider = make_approver("_rr_rc")
|
||||
with self.assertRaises(ValidationError) as ctx:
|
||||
experiment_request_changes(
|
||||
experiment=self.exp,
|
||||
user=outsider,
|
||||
comment="nope",
|
||||
)
|
||||
self.assertIn("user", ctx.exception.message_dict)
|
||||
|
||||
|
||||
class LifecycleFlowTest(TestCase):
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user