Printing tables

This document just tests the print to pdf function.

A tested document

This is a tested document. The following instructions are used for initialization:

>>> from lino import startup
>>> startup('lino_book.projects.team.settings.demo')
>>> from lino.api.doctest import *
>>> # rt.login('robin').show('tickets.ActiveTickets')
>>> settings.SITE.appy_params.update(raiseOnError=True)
>>> test_client.force_login(rt.login('robin').user)
>>> def mytest(k):
...     url = 'http://127.0.0.1:8000/api/{0}?an=as_pdf'.format(k)
...     res = test_client.get(url, REMOTE_USER='robin')
...     assert res.status_code == 200, "Request to {} got status code {}".format(url, res.status_code)
...     result = json.loads(res.content)
...     assert result['success']
...     print(result['open_url'])
>>> mytest("tickets/ActiveTickets")
/media/cache/appypdf/127.0.0.1/tickets.ActiveTickets.pdf
>>> mytest("tickets/AllTickets")
/media/cache/appypdf/127.0.0.1/tickets.AllTickets.pdf