Finish view tests

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-09-05 01:24:54 -04:00
parent cca08d8103
commit 968abe2cdb
9 changed files with 389 additions and 68 deletions

View File

@@ -1,36 +1,22 @@
from __future__ import unicode_literals
from django.test import override_settings
from mayan.apps.common.tests.base import BaseTestCase
from mayan.apps.documents.tests.base import GenericDocumentTestCase
from mayan.apps.documents.tests.mixins import DocumentTestMixin
from ..classes import ControlCode
from ..models import ControlSheet
from .mixins import ControlSheetCodeTestMixin
TEST_CONTROL_CODE_DOCUMENT_PATH = '/tmp/test_control_code.png'
class ControlCodeTest(ControlCode):
arguments = ('argument_1',)
label = 'Test'
name = 'test'
def execute(self):
pass
ControlCode.register(control_code=ControlCodeTest)
class ControlCodeTestCase(GenericDocumentTestCase):
class ControlCodeTestCase(ControlSheetCodeTestMixin, GenericDocumentTestCase):
auto_upload_document = False
test_document_path = TEST_CONTROL_CODE_DOCUMENT_PATH
def test_control_code_detection(self):
with open(TEST_CONTROL_CODE_DOCUMENT_PATH, mode='wb') as file_object:
control_code = ControlCodeTest(argument_1='test argument value')
control_code = self._test_control_code_class(
argument_1='test argument value'
)
control_code.image.save(file_object)
self.upload_document()