Merge remote-tracking branch 'origin/master' into development
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -3,12 +3,12 @@ from __future__ import unicode_literals
|
||||
import json
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
|
||||
from rest_framework import status
|
||||
|
||||
from documents.models import DocumentType
|
||||
from documents.tests import TEST_DOCUMENT_TYPE, TEST_SMALL_DOCUMENT_PATH
|
||||
from documents.tests import TEST_DOCUMENT_TYPE_LABEL, TEST_SMALL_DOCUMENT_PATH
|
||||
from rest_api.tests import BaseAPITestCase
|
||||
from user_management.tests import (
|
||||
TEST_ADMIN_EMAIL, TEST_ADMIN_PASSWORD, TEST_ADMIN_USERNAME
|
||||
@@ -33,7 +33,7 @@ class OCRAPITestCase(BaseAPITestCase):
|
||||
)
|
||||
|
||||
self.document_type = DocumentType.objects.create(
|
||||
label=TEST_DOCUMENT_TYPE
|
||||
label=TEST_DOCUMENT_TYPE_LABEL
|
||||
)
|
||||
|
||||
with open(TEST_SMALL_DOCUMENT_PATH) as file_object:
|
||||
|
||||
@@ -6,7 +6,7 @@ from common.tests import BaseTestCase
|
||||
from documents.models import DocumentType
|
||||
from documents.settings import setting_language_choices
|
||||
from documents.tests import (
|
||||
TEST_DEU_DOCUMENT_PATH, TEST_DOCUMENT_TYPE, TEST_SMALL_DOCUMENT_PATH
|
||||
TEST_DEU_DOCUMENT_PATH, TEST_DOCUMENT_TYPE_LABEL, TEST_SMALL_DOCUMENT_PATH
|
||||
)
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class DocumentOCRTestCase(BaseTestCase):
|
||||
super(DocumentOCRTestCase, self).setUp()
|
||||
|
||||
self.document_type = DocumentType.objects.create(
|
||||
label=TEST_DOCUMENT_TYPE
|
||||
label=TEST_DOCUMENT_TYPE_LABEL
|
||||
)
|
||||
|
||||
with open(TEST_SMALL_DOCUMENT_PATH) as file_object:
|
||||
@@ -46,7 +46,7 @@ class GermanOCRSupportTestCase(BaseTestCase):
|
||||
super(GermanOCRSupportTestCase, self).setUp()
|
||||
|
||||
self.document_type = DocumentType.objects.create(
|
||||
label=TEST_DOCUMENT_TYPE
|
||||
label=TEST_DOCUMENT_TYPE_LABEL
|
||||
)
|
||||
|
||||
# Get corresponding language code for German from the default language
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.test import override_settings
|
||||
from common.tests import BaseTestCase
|
||||
from documents.models import DocumentType
|
||||
from documents.tests import (
|
||||
TEST_DOCUMENT_PATH, TEST_DOCUMENT_TYPE, TEST_HYBRID_DOCUMENT_PATH
|
||||
TEST_DOCUMENT_PATH, TEST_DOCUMENT_TYPE_LABEL, TEST_HYBRID_DOCUMENT_PATH
|
||||
)
|
||||
|
||||
from ..classes import TextExtractor
|
||||
@@ -18,7 +18,7 @@ class ParserTestCase(BaseTestCase):
|
||||
def setUp(self):
|
||||
super(ParserTestCase, self).setUp()
|
||||
self.document_type = DocumentType.objects.create(
|
||||
label=TEST_DOCUMENT_TYPE
|
||||
label=TEST_DOCUMENT_TYPE_LABEL
|
||||
)
|
||||
|
||||
with open(TEST_DOCUMENT_PATH) as file_object:
|
||||
@@ -55,7 +55,7 @@ class TextExtractorTestCase(BaseTestCase):
|
||||
super(TextExtractorTestCase, self).setUp()
|
||||
|
||||
self.document_type = DocumentType.objects.create(
|
||||
label=TEST_DOCUMENT_TYPE
|
||||
label=TEST_DOCUMENT_TYPE_LABEL
|
||||
)
|
||||
|
||||
with open(TEST_HYBRID_DOCUMENT_PATH) as file_object:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.test import override_settings
|
||||
from django.utils.encoding import force_text
|
||||
|
||||
from documents.tests.test_views import GenericDocumentViewTestCase
|
||||
|
||||
@@ -30,7 +29,7 @@ class OCRViewsTestCase(GenericDocumentViewTestCase):
|
||||
self.assertEqual(response.status_code, 403)
|
||||
|
||||
def test_document_content_view_with_permission(self):
|
||||
self.grant(permission_ocr_content_view)
|
||||
self.grant_permission(permission=permission_ocr_content_view)
|
||||
|
||||
response = self._document_content_view()
|
||||
|
||||
@@ -48,7 +47,7 @@ class OCRViewsTestCase(GenericDocumentViewTestCase):
|
||||
def test_document_download_view_with_permission(self):
|
||||
self.expected_content_type = 'application/octet-stream; charset=utf-8'
|
||||
|
||||
self.grant(permission=permission_ocr_content_view)
|
||||
self.grant_permission(permission=permission_ocr_content_view)
|
||||
response = self.get(
|
||||
'ocr:document_ocr_download', args=(self.document.pk,)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user