def test_cc():
    email = EmailMessage('Subject', 'Content', '*****@*****.**',
        '*****@*****.**', cc='*****@*****.**')
    message = email.message()

    assert message['Cc'] == '*****@*****.**'
    assert email.get_recipients() == ['*****@*****.**', '*****@*****.**']
Exemple #2
0
def test_multiple_bcc():
    email = EmailMessage('Subject', 'Content', '*****@*****.**',
                         bcc=['*****@*****.**', '*****@*****.**'])
    message = email.render()

    assert not message['To']
    assert not message['Cc']
    assert not message['Bcc']  # as it should
    assert email.get_recipients() == ['*****@*****.**', '*****@*****.**']
Exemple #3
0
def test_cc():
    email = EmailMessage('Subject', 'Content', '*****@*****.**',
                         cc='*****@*****.**')
    message = email.render()

    assert message['Cc'] == '*****@*****.**'
    assert not message['To']
    assert not message['Bcc']
    assert email.get_recipients() == ['*****@*****.**']
def test_multiple_cc_and_to():
    email = EmailMessage('Subject', 'Content', '*****@*****.**',
        to=['*****@*****.**', '*****@*****.**'],
        cc=['*****@*****.**', '*****@*****.**'])
    message = email.message()

    assert message['Cc'] == '[email protected], [email protected]'
    assert email.get_recipients() == ['*****@*****.**', '*****@*****.**',
        '*****@*****.**', '*****@*****.**']
Exemple #5
0
def test_multiple_cc():
    email = EmailMessage('Subject', 'Content', '*****@*****.**',
                         cc=['*****@*****.**', '*****@*****.**'])
    message = email.render()

    print(message['Cc'])
    assert message['Cc'] == '[email protected], [email protected]'
    assert not message['To']
    assert not message['Bcc']
    assert email.get_recipients() == ['*****@*****.**', '*****@*****.**']
Exemple #6
0
def test_multiple_replyto():
    email = EmailMessage('Subject', 'Content', '*****@*****.**',
                         reply_to=['*****@*****.**', '*****@*****.**'])
    message = email.render()

    assert message['Reply-To'] == '[email protected], [email protected]'
    assert not message['To']
    assert not message['Cc']
    assert not message['Bcc']  # as it should
    assert email.get_recipients() == []
def test_recipients_as_tuple():
    email = EmailMessage('Subject', 'Content', '*****@*****.**', 
        to=('*****@*****.**', '*****@*****.**'),
        cc=('*****@*****.**', '*****@*****.**'),
        bcc=('*****@*****.**',))
    message = email.message()

    assert message['Cc'] == '[email protected], [email protected]'
    assert email.get_recipients() == ['*****@*****.**', '*****@*****.**',
        '*****@*****.**', '*****@*****.**', '*****@*****.**']
Exemple #8
0
def test_cc():
    email = EmailMessage('Subject',
                         'Content',
                         '*****@*****.**',
                         cc='*****@*****.**')
    message = email.render()

    assert message['Cc'] == '*****@*****.**'
    assert not message['To']
    assert not message['Bcc']
    assert email.get_recipients() == ['*****@*****.**']
Exemple #9
0
def test_bcc():
    email = EmailMessage('Subject',
                         'Content',
                         '*****@*****.**',
                         bcc='*****@*****.**')
    message = email.render()

    assert not message['To']
    assert not message['Cc']
    assert not message['Bcc']  # as it should
    assert email.get_recipients() == ['*****@*****.**']
Exemple #10
0
def test_multiple_cc():
    email = EmailMessage('Subject',
                         'Content',
                         '*****@*****.**',
                         cc=['*****@*****.**', '*****@*****.**'])
    message = email.render()

    print(message['Cc'])
    assert message['Cc'] == '[email protected], [email protected]'
    assert not message['To']
    assert not message['Bcc']
    assert email.get_recipients() == ['*****@*****.**', '*****@*****.**']
Exemple #11
0
def test_replyto():
    email = EmailMessage('Subject',
                         'Content',
                         '*****@*****.**',
                         reply_to='*****@*****.**')
    message = email.render()

    assert message['Reply-To'] == '*****@*****.**'
    assert not message['To']
    assert not message['Cc']
    assert not message['Bcc']  # as it should
    assert email.get_recipients() == []
Exemple #12
0
def test_multiple_to_cc_bcc():
    email = EmailMessage('Subject', 'Content', '*****@*****.**',
                         to=['*****@*****.**', '*****@*****.**'],
                         cc=['*****@*****.**', '*****@*****.**'],
                         bcc=['*****@*****.**', '*****@*****.**'])
    message = email.render()

    assert message['To'] == '[email protected], [email protected]'
    assert message['Cc'] == '[email protected], [email protected]'
    assert message['Bcc'] == '[email protected], [email protected]'
    assert email.get_recipients() == [
        '*****@*****.**', '*****@*****.**',
        '*****@*****.**', '*****@*****.**',
        '*****@*****.**', '*****@*****.**',
    ]
Exemple #13
0
def test_recipients_as_tuple():
    email = EmailMessage('Subject',
                         'Content',
                         '*****@*****.**',
                         to=('*****@*****.**', '*****@*****.**'),
                         cc=('*****@*****.**', '*****@*****.**'),
                         bcc=('*****@*****.**', ))
    message = email.render()

    assert message['To'] == '[email protected], [email protected]'
    assert message['Cc'] == '[email protected], [email protected]'
    assert not message['Bcc']  # as it should
    assert email.get_recipients() == [
        '*****@*****.**',
        '*****@*****.**',
        '*****@*****.**',
        '*****@*****.**',
        '*****@*****.**',
    ]
Exemple #14
0
def test_multiple_to_cc_bcc():
    email = EmailMessage('Subject',
                         'Content',
                         '*****@*****.**',
                         to=['*****@*****.**', '*****@*****.**'],
                         cc=['*****@*****.**', '*****@*****.**'],
                         bcc=['*****@*****.**', '*****@*****.**'])
    message = email.render()

    assert message['To'] == '[email protected], [email protected]'
    assert message['Cc'] == '[email protected], [email protected]'
    assert not message['Bcc']  # as it should
    assert email.get_recipients() == [
        '*****@*****.**',
        '*****@*****.**',
        '*****@*****.**',
        '*****@*****.**',
        '*****@*****.**',
        '*****@*****.**',
    ]