Exemplo n.º 1
0
def test_unicode_message_generation(event, default_account):
    from inbox.events.ical import generate_invite_message
    event.title = u'Dîner chez François et Hélène'
    event.description = u"""Cher Paul,
Je suis heureux de vous inviter à un diner le samedi 19 novembre 2011 à 19h30
au chalet de l'île Daumesnil dans le bois de Vincennes.

Je vous attend avec impatience. Bien à vous.
Hélène (Ἑλένη)
"""

    event.participants = [{'email': 'hélè[email protected]'}]
    generate_invite_message('empty', event, default_account)
Exemplo n.º 2
0
def test_unicode_message_generation(event, default_account):
    from inbox.events.ical import generate_invite_message
    event.title = u'Dîner chez François et Hélène'
    event.description = u"""Cher Paul,
Je suis heureux de vous inviter à un diner le samedi 19 novembre 2011 à 19h30
au chalet de l'île Daumesnil dans le bois de Vincennes.

Je vous attend avec impatience. Bien à vous.
Hélène (Ἑλένη)
"""

    event.participants = [{'email': 'hélè[email protected]'}]
    generate_invite_message('empty', event, default_account)
Exemplo n.º 3
0
def test_message_generation(event, default_account):
    from inbox.events.ical import generate_invite_message

    event.title = "A long walk on the beach"
    event.participants = [{"email": "*****@*****.**"}]
    msg = generate_invite_message("empty", event, default_account)

    # Make sure the From header is set correctly
    assert msg.headers["From"] == "*****@*****.**"

    # Check that we have an email with an HTML part, a plain text part, a
    # text/calendar with METHOD=REQUEST and an attachment.
    count = 0
    for mimepart in msg.walk(with_self=msg.content_type.is_singlepart()):
        format_type = mimepart.content_type.format_type
        subtype = mimepart.content_type.subtype

        if (format_type, subtype) in [
            ("text", "plain"),
            ("text", "html"),
            ("text", "calendar; method=request"),
            ("application", "ics"),
        ]:
            count += 1
    assert count == 3
Exemplo n.º 4
0
def test_message_generation(event, default_account):
    from inbox.events.ical import generate_invite_message
    event.title = 'A long walk on the beach'
    event.participants = [{'email': '*****@*****.**'}]
    msg = generate_invite_message('empty', event, default_account)

    # Check that we have an email with an HTML part, a plain text part, a
    # text/calendar with METHOD=REQUEST and an attachment.

    count = 0
    for mimepart in msg.walk(with_self=msg.content_type.is_singlepart()):
        format_type = mimepart.content_type.format_type
        subtype = mimepart.content_type.subtype

        if (format_type, subtype) in [('text', 'plain'), ('text', 'html'),
                                      ('text', 'calendar; method=request'),
                                      ('application', 'ics')]:
            count += 1
    assert count == 3