Beispiel #1
0
def test_command_output_format(mailoutbox):
    AlertFactory(title='Gloubiboukmark', querystring='text=Schtroumpf')
    AidFactory.create(name='Schtroumpf 1')
    AidFactory.create(name='Schtroumpf 2')
    AidFactory.create(name='Schtroumpf 3')
    AidFactory.create(name='Schtroumpf 4')
    call_command('send_alerts')

    content = mailoutbox[0].body
    assert 'Gloubiboukmark' in content
    assert 'Schtroumpf 1' in content
    assert 'Schtroumpf 2' in content
    assert 'Schtroumpf 3' in content

    # Only the first three aids are in the mail
    assert 'Schtroumpf 4' not in content
    assert 'encore d\'autres aides disponibles !' in content
Beispiel #2
0
def test_command_output_format(mailoutbox):
    AlertFactory(
        title='Gloubiboukmark',
        querystring='text=Schtroumpf')
    AidFactory.create(name='Schtroumpf 1')
    AidFactory.create(name='Schtroumpf 2')
    AidFactory.create(name='Schtroumpf 3')
    AidFactory.create(name='Schtroumpf 4')
    call_command('send_alerts')

    content = mailoutbox[0].body
    assert 'Gloubiboukmark' in content
    assert 'Schtroumpf 1' in content
    assert 'Schtroumpf 2' in content
    assert 'Schtroumpf 3' in content

    # Only the first three aids are in the mail
    assert 'Schtroumpf 4' not in content
    assert 'encore d\'autres aides disponibles !' in content

    # The "extra search" link should include these parameters
    assert 'published_after=' in content
    assert 'action=alert' in content