def test_arrival_slip_fits_on_one_page(running_app, db):
    db.clear()
    db.add_dewar(
        {
            "name": "d-123a-1",
            "owner": "Jane",
            "department": "Chemistry",
            "institute": "Some University",
            "streetAddress": "123 Main Road",
            "city": "Brisbane",
            "state": "Queensland",
            "postcode": "3000",
            "country": "Australia",
            "phone": "111-222-333",
            "email": "*****@*****.**",
            "epn": "123a",
            "returnDewar": True,
            "courier": "Fast Deliveries",
            "courierAccount": "999",
            "container_type": "pucks",
            "expectedContainers": "1 | 2 | 3 | 4 | 5 |  |  | ",
        }
    )
    url = url_for("main.arrival_slip", dewar_name="d-123a-1")
    with BytesIO() as file:
        page_to_pdf(url, file)
        reader = PdfFileReader(file)
        assert reader.numPages == 1
def test_page_to_pdf():
    with BytesIO() as file:
        page_to_pdf('https://httpbin.org/html', file)
        reader = PdfFileReader(file)
        assert reader.numPages >= 1