Use TransactionTestCase to try to avoid exceptions in a test blocking DB access in others

This commit is contained in:
Roberto Rosario
2015-01-05 03:34:00 -04:00
parent c5be844097
commit a4d3a73117

View File

@@ -2,7 +2,7 @@ from __future__ import absolute_import
from django.conf import settings
from django.core.files.base import File
from django.test import TestCase
from django.test import TransactionTestCase
from documents.models import Document, DocumentType
from documents.tests import TEST_SMALL_DOCUMENT_PATH, TEST_DOCUMENT_TYPE
@@ -11,7 +11,7 @@ from .api import do_document_ocr
from .models import DocumentQueue, QueueDocument
class DocumentOCRTestCase(TestCase):
class DocumentOCRTestCase(TransactionTestCase):
def setUp(self):
self.document_type = DocumentType.objects.create(name=TEST_DOCUMENT_TYPE, ocr=False)