Add test for in_cluster patch
@@ -1047,6 +1047,22 @@ class TestExperimentDetailViewV1(BaseViewTest):
assert new_object.description == new_description
assert new_object.jobs.count() == 2
+ # path in_cluter
+ data = {'in_cluster': False}
+ assert self.object.in_cluster is True
+ resp = self.auth_client.patch(self.url, data=data)
+ assert resp.status_code == status.HTTP_200_OK
+ new_object = self.model_class.objects.get(id=self.object.id)
+ assert new_object.jobs.count() == 2
+ assert new_object.in_cluster is False
+
+ data = {'in_cluster': True}
+ resp = self.auth_client.patch(self.url, data=data)
+ assert resp.status_code == status.HTTP_200_OK
+ new_object = self.model_class.objects.get(id=self.object.id)
+ assert new_object.jobs.count() == 2
+ assert new_object.in_cluster is True
+
# Update original experiment
assert new_object.is_clone is False
new_experiment = ExperimentFactory()
