Test simplification

Unify usage of self.test_document and self.test_documents in
tests.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-05-07 00:54:59 -04:00
parent ebc68d3c36
commit a0d2000419
36 changed files with 306 additions and 276 deletions
+4 -4
View File
@@ -12,13 +12,13 @@ from ..events import (
class OCREventsTestCase(GenericDocumentTestCase):
def test_document_version_submit_event(self):
Action.objects.all().delete()
self.document.submit_for_ocr()
self.test_document.submit_for_ocr()
# Get the oldest action
action = Action.objects.order_by('-timestamp').last()
self.assertEqual(
action.target, self.document.latest_version
action.target, self.test_document.latest_version
)
self.assertEqual(
action.verb, event_ocr_document_version_submit.id
@@ -26,13 +26,13 @@ class OCREventsTestCase(GenericDocumentTestCase):
def test_document_version_finish_event(self):
Action.objects.all().delete()
self.document.submit_for_ocr()
self.test_document.submit_for_ocr()
# Get the most recent action
action = Action.objects.order_by('-timestamp').first()
self.assertEqual(
action.target, self.document.latest_version
action.target, self.test_document.latest_version
)
self.assertEqual(
action.verb, event_ocr_document_version_finish.id
+1 -1
View File
@@ -16,7 +16,7 @@ class OCRIndexingTestCase(DocumentTestMixin, BaseTestCase):
def test_ocr_indexing(self):
index = Index.objects.create(label=TEST_INDEX_LABEL)
index.document_types.add(self.document_type)
index.document_types.add(self.test_document_type)
root = index.template_root
index.node_templates.create(
+1 -1
View File
@@ -20,7 +20,7 @@ class DocumentOCRTestCase(DocumentTestMixin, BaseTestCase):
_skip_file_descriptor_test = True
def test_ocr_language_backends_end(self):
content = self.document.pages.first().ocr_content.content
content = self.test_document.pages.first().ocr_content.content
self.assertTrue(TEST_DOCUMENT_CONTENT in content)