def patch_message_middleware(request):
    setattr(request, 'session', 'session')
    messages = FallbackStorage(request)
    setattr(request, '_messages', messages)
    return request
Testing the PUT review-requests/<id>/draft/ API
dataset/ETHPy150Open ofa/connect/open_connect/connectmessages/tests/test_views.py/patch_message_middleware--crossover with--dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/webapi/tests/test_review_request_draft.py/ResourceTests.test_put_with_text_type_plain