Message ID | 10d35c17-fae5-f4b4-efda-0a920bdd37d9@laxalde.org |
---|---|
State | Not Applicable |
Headers | show |
diff --git a/patchwork/tests/test_rest_api.py b/patchwork/tests/test_rest_api.py index 88b7163..70ef1fe 100644 --- a/patchwork/tests/test_rest_api.py +++ b/patchwork/tests/test_rest_api.py @@ -398,6 +398,12 @@ class TestPatchAPI(APITestCase): self.assertEqual(status.HTTP_200_OK, resp.status_code) self.assertEqual(Patch.objects.get(id=patch.id).state, state) + # state not in choices + resp = self.client.patch(self.api_url(patch.id), {'state': 'unknown'}) + self.assertEqual(status.HTTP_400_BAD_REQUEST, resp.status_code) + self.assertEqual(['Invalid state. Expected one of: state_0, state_1 '], + resp.json()['state']) + def test_delete(self):