Split document.tests.test_views.
Signed-off-by: Michael Price <loneviking72@gmail.com>
This commit is contained in:
committed by
Roberto Rosario
parent
77777deec5
commit
96836065a8
35
mayan/apps/documents/tests/base.py
Normal file
35
mayan/apps/documents/tests/base.py
Normal file
@@ -0,0 +1,35 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.test import override_settings
|
||||
|
||||
from common.tests.test_views import GenericViewTestCase
|
||||
|
||||
from ..models import DocumentType
|
||||
|
||||
from .literals import (
|
||||
TEST_DOCUMENT_TYPE_LABEL, TEST_SMALL_DOCUMENT_FILENAME,
|
||||
TEST_SMALL_DOCUMENT_PATH,
|
||||
)
|
||||
|
||||
|
||||
@override_settings(OCR_AUTO_OCR=False)
|
||||
class GenericDocumentViewTestCase(GenericViewTestCase):
|
||||
test_document_filename = TEST_SMALL_DOCUMENT_FILENAME
|
||||
|
||||
def setUp(self):
|
||||
super(GenericDocumentViewTestCase, self).setUp()
|
||||
self.document_type = DocumentType.objects.create(
|
||||
label=TEST_DOCUMENT_TYPE_LABEL
|
||||
)
|
||||
|
||||
with open(TEST_SMALL_DOCUMENT_PATH) as file_object:
|
||||
self.document = self.document_type.new_document(
|
||||
file_object=file_object, label=self.test_document_filename
|
||||
)
|
||||
|
||||
def tearDown(self):
|
||||
if self.document_type.pk:
|
||||
self.document_type.delete()
|
||||
super(GenericDocumentViewTestCase, self).tearDown()
|
||||
Reference in New Issue
Block a user