コード例 #1
0
ファイル: test_noop.py プロジェクト: SpotOnInc/espwrap
def test_add_recipients():
    '''
    Test that a list of recipients can be added in bulk, assigning a default
    empty dict of merge vars when not provided
    '''

    me = NoopMassEmail()

    me.add_recipients([
        {
            'email': '*****@*****.**',
            'name': 'Some test dude',
            'merge_vars': {'SOMETHING': 'test'},
        },
        {
            'email': '*****@*****.**',
            'name': 'Some test dude',
        },
    ])

    recips = me.get_recipients()

    assert len(recips) == 2

    recips = [x for x in me.get_recipients() if x.get('merge_vars') == {}]

    assert len(recips) == 1
コード例 #2
0
ファイル: test_noop.py プロジェクト: tomohara/espwrap
def test_add_recipients():
    '''
    Test that a list of recipients can be added in bulk, assigning a default
    empty dict of merge vars when not provided
    '''

    me = NoopMassEmail()

    me.add_recipients([
        {
            'email': '*****@*****.**',
            'name': 'Some test dude',
            'merge_vars': {
                'SOMETHING': 'test'
            },
        },
        {
            'email': '*****@*****.**',
            'name': 'Some test dude',
        },
    ])

    recips = me.get_recipients()

    assert len(recips) == 2

    recips = [x for x in me.get_recipients() if x.get('merge_vars') == {}]

    assert len(recips) == 1
コード例 #3
0
ファイル: test_noop.py プロジェクト: SpotOnInc/espwrap
def test_can_lazily_add_recipients_and_solidify():
    gen_count = 20

    me = NoopMassEmail()

    me.add_recipients(generate_recipients(gen_count))

    recips = me.get_raw_recipients()

    assert hasattr(recips, '__iter__') and not hasattr(recips, '__len__')

    recips_list = me.solidify_recipients()

    assert len(recips_list) == gen_count
コード例 #4
0
ファイル: test_noop.py プロジェクト: tomohara/espwrap
def test_can_lazily_add_recipients_and_solidify():
    gen_count = 20

    me = NoopMassEmail()

    me.add_recipients(generate_recipients(gen_count))

    recips = me.get_raw_recipients()

    assert hasattr(recips, '__iter__') and not hasattr(recips, '__len__')

    recips_list = me.solidify_recipients()

    assert len(recips_list) == gen_count