import pytest import teal.marshmallow from ereuse_utils.test import ANY import csv from datetime import datetime from io import StringIO from pathlib import Path from ereuse_devicehub.client import Client, UserClient from ereuse_devicehub.resources.action.models import Snapshot from ereuse_devicehub.resources.documents import documents from tests.conftest import file @pytest.mark.mvp 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=Snapshot) doc, response = user.get(res=documents.DocumentDef.t, item='erasures/{}'.format(snapshot['device']['id']), accept=ANY) assert 'html' in response.content_type assert '