import teal.marshmallow from ereuse_utils.test import ANY from ereuse_devicehub.client import Client, UserClient from ereuse_devicehub.resources.documents import documents as docs from ereuse_devicehub.resources.event import models as e from tests.conftest import file def test_erasure_certificate_public_one(user: UserClient, client: Client): """Public user can get certificate from one device as HTML or PDF.""" s = file('erase-sectors.snapshot') snapshot, _ = user.post(s, res=e.Snapshot) doc, response = client.get(res=docs.DocumentDef.t, item='erasures/{}'.format(snapshot['device']['id']), accept=ANY) assert 'html' in response.content_type assert '