def test_json_body_before_req_func_no_content_type(self): # Unset with self.test_request_context(data='{"key": "value"}'): # No exception should be raised, everything is happy. json_body.json_body_before_request() # Explicitly set to '' with self.test_request_context(headers={'Content-Type': ''}, data='{"key": "value"}'): # No exception should be raised, everything is happy. json_body.json_body_before_request()
def test_json_body_before_req_func_unrecognized_conten_type_no_body(self): with self.test_request_context( headers={'Content-Type': 'unrecognized/content-type'}): # No exception should be raised, everything is happy. json_body.json_body_before_request()
def test_json_body_before_req_func_valid_json(self): with self.test_request_context( headers={'Content-Type': 'application/json'}, data='{"key": "value"}'): # No exception should be raised, everything is happy. json_body.json_body_before_request()