示例#1
0
    def test_default_content_type(self, req, includes):
        del req["headers"]["Content-Type"]

        args = get_request_args(req, includes)

        assert args["headers"]["content-type"] == "application/json"
示例#2
0
    def test_file_and_data_fails(self, req, includes):
        """Can't send json/form data and files at once"""
        req["files"] = ["abc"]

        with pytest.raises(exceptions.BadSchemaError):
            get_request_args(req, includes)
示例#3
0
    def test_no_override_method(self, req, includes):
        req["method"] = "POST"

        args = get_request_args(req, includes)

        assert args["method"] == "POST"
示例#4
0
    def test_array_substitution(self, req, includes):
        args = get_request_args(req, includes)

        assert args['data']['array'] == ['def456', 'def456']