From c1c89e196c7ecbc91dd1f3237cd546ef633490c4 Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Thu, 19 Sep 2019 15:49:39 +0200 Subject: #915: Return 400 status code in POST methods when no payload is attached If no payload is attached to method that requires a payload, then the API returns a 400 status code (following RFC 7231) instead of the previous 404. test_0001_get_clients.py is also modified to fit the new status code. --- tests/units/test_0001_get_clients.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/units') diff --git a/tests/units/test_0001_get_clients.py b/tests/units/test_0001_get_clients.py index 8d52bb8..218b41a 100644 --- a/tests/units/test_0001_get_clients.py +++ b/tests/units/test_0001_get_clients.py @@ -13,7 +13,7 @@ class TestGetClientsMethods(unittest.TestCase): def test_post_without_data(self): returned = requests.post(self.url, headers=self.headers) - self.assertEqual(returned.status_code, 404) + self.assertEqual(returned.status_code, 400) if __name__ == '__main__': unittest.main() -- cgit v1.2.3-18-g5258