Merge remote-tracking branch 'origin/versions/micro' into feature/merge_with_micro

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-10-01 15:31:32 -04:00
1147 changed files with 6475 additions and 4128 deletions
+8
View File
@@ -10,6 +10,14 @@ from .literals import (
)
class SmartLinkDocumentViewTestMixin(object):
def _request_test_smart_link_document_instances_view(self):
return self.get(
viewname='linking:smart_link_instances_for_document',
kwargs={'pk': self.test_document.pk}
)
class SmartLinkTestMixin(object):
def _create_test_smart_link(self, add_test_document_type=False):
self.test_smart_link = SmartLink.objects.create(
File diff suppressed because it is too large Load Diff
+14 -10
View File
@@ -14,10 +14,15 @@ from .literals import (
TEST_SMART_LINK_DYNAMIC_LABEL, TEST_SMART_LINK_LABEL_EDITED,
TEST_SMART_LINK_LABEL
)
from .mixins import SmartLinkTestMixin, SmartLinkViewTestMixin
from .mixins import (
SmartLinkDocumentViewTestMixin, SmartLinkTestMixin,
SmartLinkViewTestMixin
)
class SmartLinkViewTestCase(SmartLinkTestMixin, SmartLinkViewTestMixin, GenericViewTestCase):
class SmartLinkViewTestCase(
SmartLinkTestMixin, SmartLinkViewTestMixin, GenericViewTestCase
):
def test_smart_link_create_view_no_permission(self):
response = self._request_test_smart_link_create_view()
self.assertEqual(response.status_code, 403)
@@ -74,10 +79,15 @@ class SmartLinkViewTestCase(SmartLinkTestMixin, SmartLinkViewTestMixin, GenericV
self.assertEqual(response.status_code, 302)
self.test_smart_link.refresh_from_db()
self.assertEqual(self.test_smart_link.label, TEST_SMART_LINK_LABEL_EDITED)
self.assertEqual(
self.test_smart_link.label, TEST_SMART_LINK_LABEL_EDITED
)
class SmartLinkDocumentViewTestCase(SmartLinkTestMixin, GenericDocumentViewTestCase):
class SmartLinkDocumentViewTestCase(
SmartLinkTestMixin, SmartLinkDocumentViewTestMixin,
GenericDocumentViewTestCase
):
def setUp(self):
super(SmartLinkDocumentViewTestCase, self).setUp()
self._create_test_smart_link()
@@ -89,12 +99,6 @@ class SmartLinkDocumentViewTestCase(SmartLinkTestMixin, GenericDocumentViewTestC
)
self.test_smart_link_2.document_types.add(self.test_document_type)
def _request_test_smart_link_document_instances_view(self):
return self.get(
viewname='linking:smart_link_instances_for_document',
kwargs={'pk': self.test_document.pk}
)
def test_document_smart_link_list_view_no_permission(self):
self.grant_access(
obj=self.test_document, permission=permission_document_view