'Ensure that the request\'s path is correctly assembled, regardless of
whether or not the FORCE_SCRIPT_NAME setting has a trailing slash.
Refs #20169.'

def test_wsgirequest_path_with_force_script_name_trailing_slash(self):

    with override_settings(FORCE_SCRIPT_NAME=u'/FORCED_PREFIX/'):
        request = WSGIRequest({u'PATH_INFO': u'/somepath/', u'REQUEST_METHOD': u'get', u'wsgi.input': BytesIO('')})
        self.assertEqual(request.path, u'/FORCED_PREFIX/somepath/')
    with override_settings(FORCE_SCRIPT_NAME=u'/FORCED_PREFIX'):
        request = WSGIRequest({u'PATH_INFO': u'/somepath/', u'REQUEST_METHOD': u'get', u'wsgi.input': BytesIO('')})
        self.assertEqual(request.path, u'/FORCED_PREFIX/somepath/')
