Update all tests to use setting value overriding.
This commit is contained in:
@@ -5,7 +5,7 @@ import tempfile
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.files.base import File
|
||||
from django.test import TestCase
|
||||
from django.test import TestCase, override_settings
|
||||
from django.test.client import Client
|
||||
|
||||
from documents.models import Document, DocumentType
|
||||
@@ -20,6 +20,7 @@ from ..literals import SOURCE_UNCOMPRESS_CHOICE_Y
|
||||
from ..models import WatchFolderSource, WebFormSource
|
||||
|
||||
|
||||
@override_settings(OCR_AUTO_OCR=False)
|
||||
class UploadDocumentTestCase(TestCase):
|
||||
"""
|
||||
Test creating documents
|
||||
@@ -29,9 +30,6 @@ class UploadDocumentTestCase(TestCase):
|
||||
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()
|
||||
|
||||
self.admin_user = User.objects.create_superuser(
|
||||
username=TEST_ADMIN_USERNAME, email=TEST_ADMIN_EMAIL,
|
||||
@@ -92,16 +90,13 @@ class UploadDocumentTestCase(TestCase):
|
||||
shutil.rmtree(temporary_directory)
|
||||
|
||||
|
||||
@override_settings(OCR_AUTO_OCR=False)
|
||||
class CompressedUploadsTestCase(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()
|
||||
|
||||
def tearDown(self):
|
||||
self.document_type.delete()
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test.client import Client
|
||||
from django.test import TestCase
|
||||
from django.test import TestCase, override_settings
|
||||
|
||||
from documents.models import Document, DocumentType
|
||||
from documents.tests import (
|
||||
@@ -15,6 +15,7 @@ from sources.literals import SOURCE_CHOICE_WEB_FORM
|
||||
from sources.models import WebFormSource
|
||||
|
||||
|
||||
@override_settings(OCR_AUTO_OCR=False)
|
||||
class UploadDocumentTestCase(TestCase):
|
||||
"""
|
||||
Test creating documents
|
||||
@@ -24,9 +25,6 @@ class UploadDocumentTestCase(TestCase):
|
||||
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()
|
||||
|
||||
self.admin_user = User.objects.create_superuser(
|
||||
username=TEST_ADMIN_USERNAME, email=TEST_ADMIN_EMAIL,
|
||||
|
||||
Reference in New Issue
Block a user