def test_put_member_warning_exception(self, wrn_vw_app_creator): root = get_service() # Need to start the service manually - no request root has been set # yet. root.start() coll = root['foos'] mb = FooMember(FooEntity(id=0)) coll.add(mb) transaction.commit() path = '/'.join((self.path, '0')) # First PUT - get back a 307. res1 = wrn_vw_app_creator.put(path, params='foo name', status=307) assert res1.body.startswith(b'307 Temporary Redirect') # Second PUT to redirection location - get back a 200. resubmit_location1 = res1.headers['Location'] res2 = wrn_vw_app_creator.put(resubmit_location1, params='foo name', status=200) assert not res2 is None
def _extract_request_data(self): foo = FooEntity(name=self.request.body) return FooMember(foo)