'Test to check the prepare flag is properly set, This should only happen for V5 at the moment.
@since 3.9
@jira_ticket PYTHON-713
@expected_result the values are correctly written
@test_category connection'

def test_prepare_flag(self):

    message = PrepareMessage('a')
    io = Mock()
    for version in ProtocolVersion.SUPPORTED_VERSIONS:
        message.send_body(io, version)
        if ProtocolVersion.uses_prepare_flags(version):
            self.assertEqual(len(io.write.mock_calls), 3)
        else:
            self.assertEqual(len(io.write.mock_calls), 2)
        io.reset_mock()
