From 1f213450c22c7bdc47ec80d8c07a262539561937 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sun, 12 Jul 2015 03:46:19 -0400 Subject: [PATCH] Change the way the ocr tests acquired document version text. --- mayan/apps/ocr/test_models.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/mayan/apps/ocr/test_models.py b/mayan/apps/ocr/test_models.py index dbc425ff08..4f90ab6a3f 100644 --- a/mayan/apps/ocr/test_models.py +++ b/mayan/apps/ocr/test_models.py @@ -1,27 +1,22 @@ from __future__ import unicode_literals from django.core.files.base import File -from django.test import TransactionTestCase +from django.test import TestCase from documents.models import DocumentType from documents.test_models import TEST_SMALL_DOCUMENT_PATH, TEST_DOCUMENT_TYPE -class DocumentOCRTestCase(TransactionTestCase): +class DocumentOCRTestCase(TestCase): def setUp(self): self.document_type = DocumentType.objects.create(label=TEST_DOCUMENT_TYPE) - ocr_settings = self.document_type.ocr_settings - ocr_settings.auto_ocr = False - ocr_settings.save() - with open(TEST_SMALL_DOCUMENT_PATH) as file_object: - self.document = self.document_type.new_document(file_object=File(file_object)) + self.document = self.document_type.new_document(file_object=File(file_object), label='small document') def tearDown(self): self.document.delete() self.document_type.delete() def test_ocr_language_backends_end(self): - self.document.submit_for_ocr() self.assertTrue('Mayan EDMS Documentation' in self.document.pages.first().ocr_content.content)