Files
mayan-edms/mayan/apps/document_parsing/tests/test_events.py
Roberto Rosario 8e69178e07 Project: Switch to full app paths
Instead of inserting the path of the apps into the Python app,
the apps are now referenced by their full import path.

This app name claves with external or native Python libraries.
Example: Mayan statistics app vs. Python new statistics library.

Every app reference is now prepended with 'mayan.apps'.

Existing config.yml files need to be updated manually.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-12-05 02:04:20 -04:00

40 lines
1.2 KiB
Python

from __future__ import unicode_literals
from actstream.models import Action
from mayan.apps.documents.tests.literals import TEST_DOCUMENT_FILENAME
from mayan.apps.documents.tests.test_models import GenericDocumentTestCase
from ..events import (
event_parsing_document_version_submit,
event_parsing_document_version_finish
)
class DocumentParsingEventsTestCase(GenericDocumentTestCase):
# Ensure we use a PDF file
test_document_filename = TEST_DOCUMENT_FILENAME
def test_document_version_submit_event(self):
Action.objects.all().delete()
self.document.submit_for_parsing()
self.assertEqual(
Action.objects.last().target, self.document.latest_version
)
self.assertEqual(
Action.objects.last().verb,
event_parsing_document_version_submit.id
)
def test_document_version_finish_event(self):
Action.objects.all().delete()
self.document.submit_for_parsing()
self.assertEqual(
Action.objects.first().target, self.document.latest_version
)
self.assertEqual(
Action.objects.first().verb,
event_parsing_document_version_finish.id
)