Exemplo n.º 1
0
def parse_email(path, taskmanager):
    file = add_email_to_collection(path)
    filesystem.handle_file(file.pk)
    digests.launch(file.blob, file.collection.pk)
    taskmanager.run()
    [digest] = file.blob.digest_set.all()
    return digests.get_document_data(digest)
Exemplo n.º 2
0
def test_attachment_children(taskmanager):
    file = add_email_to_collection(OCTET_STREAM_CONTENT_TYPE)
    filesystem.handle_file(file.pk)
    taskmanager.run()

    attachments_dir = file.child_directory_set.get()
    children = attachments_dir.child_file_set.order_by('pk').all()

    assert len(children) == 3
    assert children[0].name == 'letterlegal5.doc'
    assert children[1].name == 'zip-with-pdf.zip'
    assert children[2].name == 'length.png'