The .id now also returns the namespace. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
36 lines
1016 B
Python
36 lines
1016 B
Python
from __future__ import unicode_literals
|
|
|
|
from actstream.models import Action
|
|
|
|
from documents.tests.test_models import GenericDocumentTestCase
|
|
|
|
from ..events import (
|
|
event_ocr_document_version_submit, event_ocr_document_version_finish
|
|
)
|
|
|
|
|
|
class OCREventsTestCase(GenericDocumentTestCase):
|
|
def test_document_version_submit_event(self):
|
|
Action.objects.all().delete()
|
|
self.document.submit_for_ocr()
|
|
|
|
self.assertEqual(
|
|
Action.objects.last().target, self.document.latest_version
|
|
)
|
|
self.assertEqual(
|
|
Action.objects.last().verb,
|
|
event_ocr_document_version_submit.id
|
|
)
|
|
|
|
def test_document_version_finish_event(self):
|
|
Action.objects.all().delete()
|
|
self.document.submit_for_ocr()
|
|
|
|
self.assertEqual(
|
|
Action.objects.first().target, self.document.latest_version
|
|
)
|
|
self.assertEqual(
|
|
Action.objects.first().verb,
|
|
event_ocr_document_version_finish.id
|
|
)
|