Exemplo n.º 1
0
def generate_messages(today):
    logos = Logo.messages_listing()

    template_path = Path(__file__).parent / 'templates' / 'logo_metrics.html'
    template = Template(template_path.read_text())

    return (create_message(logo, template, today) for logo in logos)
Exemplo n.º 2
0
def test_messages_listing(db_connection):
    logo1 = create_logo('1', email_reports=True)
    logo2 = create_logo('2', email_reports=False)  # noqa
    logo3 = create_logo('3', email_reports=True)

    assert set(Logo.messages_listing()) == {logo1, logo3}