From 4c581aac489979c043efc2ba2e780e5beef879c8 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Tue, 30 Apr 2013 15:26:06 +1000 Subject: [PATCH] Test changing the default status_code in pecan --- tests/pecantest/test/controllers/ws.py | 2 +- tests/pecantest/test/tests/test_ws.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/pecantest/test/controllers/ws.py b/tests/pecantest/test/controllers/ws.py index 05b640d..12bdd66 100644 --- a/tests/pecantest/test/controllers/ws.py +++ b/tests/pecantest/test/controllers/ws.py @@ -85,7 +85,7 @@ class AuthorsController(RestController): ] return author - @wsmeext.pecan.wsexpose(Author, body=Author) + @wsmeext.pecan.wsexpose(Author, body=Author, status_code=201) def post(self, author): author.id = 10 return author diff --git a/tests/pecantest/test/tests/test_ws.py b/tests/pecantest/test/tests/test_ws.py index af8942c..7916672 100644 --- a/tests/pecantest/test/tests/test_ws.py +++ b/tests/pecantest/test/tests/test_ws.py @@ -63,6 +63,7 @@ class TestWS(FunctionalTest): '/authors', '{"firstname": "test"}', headers={"Content-Type": "application/json"} ) + assert res.status_int == 201 a = json.loads(res.body) print a assert a['id'] == 10