Esempio n. 1
0
def task_pdf_view(request):
    """
        Returns a pdf rendering of the current task
    """
    from autonomie.resources import pdf_css
    pdf_css.need()

    number = request.context.internal_number
    label = force_filename(number)

    filename = u"{0}.pdf".format(label)

    html_string = html(request)
    write_pdf(request, filename, html_string)

    return request.response
Esempio n. 2
0
def test_force_filename():
    assert force_filename(u"é' ';^") == u"e_"