Files
mayan-edms/mayan/apps/file_metadata/tests/test_events.py
Roberto Rosario 0a7908baca File metadata: Add file metadata app
Add the file metadata app. This app uses binary wrappers called drivers
to extract properties from the file of documents. The default driver
uses the exiftool to extract the EXIF record from JPEG images.
The exiftool can also extra some properties from other files like
PDFs, office files and sound file.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
2018-12-14 02:16:38 -04:00

41 lines
1.2 KiB
Python

from __future__ import unicode_literals
from actstream.models import Action
from mayan.apps.documents.tests.test_models import GenericDocumentTestCase
from ..events import (
event_file_metadata_document_version_finish,
event_file_metadata_document_version_submit
)
class FileMetadataEventsTestCase(GenericDocumentTestCase):
def test_document_version_finish_event(self):
Action.objects.all().delete()
self.document.latest_version.submit_for_file_metadata_processing()
# Get the most recent action
action = Action.objects.order_by('-timestamp').first()
self.assertEqual(
action.target, self.document.latest_version
)
self.assertEqual(
action.verb, event_file_metadata_document_version_finish.id
)
def test_document_version_submit_event(self):
Action.objects.all().delete()
self.document.latest_version.submit_for_file_metadata_processing()
# Get the oldest action
action = Action.objects.order_by('-timestamp').last()
self.assertEqual(
action.target, self.document.latest_version
)
self.assertEqual(
action.verb, event_file_metadata_document_version_submit.id
)