Update all tests to use setting value overriding.

This commit is contained in:
Roberto Rosario
2015-09-06 04:01:40 -04:00
parent f59b96ac5e
commit 3e3eca4c0e
16 changed files with 42 additions and 103 deletions
+5 -9
View File
@@ -1,7 +1,7 @@
from __future__ import unicode_literals
from django.core.files.base import File
from django.test import TestCase
from django.test import TestCase, override_settings
from documents.models import DocumentType
from documents.tests import (
@@ -10,18 +10,17 @@ from documents.tests import (
from ..classes import TextExtractor
from ..parsers import PDFMinerParser, PopplerParser
from ..settings import setting_auto_ocr
@override_settings(OCR_AUTO_OCR=False)
class ParserTestCase(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_DOCUMENT_PATH) as file_object:
self.document = self.document_type.new_document(
file_object=File(file_object)
@@ -50,16 +49,13 @@ class ParserTestCase(TestCase):
)
@override_settings(OCR_AUTO_OCR=False)
class TextExtractorTestCase(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_HYBRID_DOCUMENT_PATH) as file_object:
self.document = self.document_type.new_document(
file_object=File(file_object)