Refactor mock_post setup