def simulate_request(self, method='GET', path='/', query_string=None,
                         headers=None, body=None, file_wrapper=None):

        if not path.startswith('/'):
            raise ValueError("path must start with '/'")

        if query_string and query_string.startswith('?'):
            raise ValueError("query_string should not start with '?'")

        if '?' in path:
            # NOTE(kgriffs): We could allow this, but then we'd need
            #   to define semantics regarding whether the path takes
            #   precedence over the query_string. Also, it would make
            #   tests less consistent, since there would be "more than
            #   one...way to do it."
            raise ValueError(
                'path may not contain a query string. Please use the '
                'query_string parameter instead.'
            )

        env = create_environ(
            method=method,
            path=path,
            query_string=(query_string or ''),
            headers=headers,
            body=body,
            file_wrapper=file_wrapper,
        )

        srmock = StartResponseMock()
        validator = wsgiref.validate.validator(self.api)
        iterable = validator(env, srmock)

        result = Result(iterable, srmock.status, srmock.headers)

        return result
Test that regular users cannot view the form to message regular users
dataset/ETHPy150Open falconry/falcon/falcon/testing/test_case.py/TestCase.simulate_request--crossover with--dataset/ETHPy150Open ofa/connect/open_connect/connectmessages/tests/test_views.py/DirectMessageCreateViewTest.test_regular_user_cannot_get_form_regular_users