Merge remote-tracking branch 'origin/versions/micro' into merges/micro_to_minor
Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -38,7 +38,9 @@ class KeyTestMixin(object):
|
||||
class KeyViewTestMixin(object):
|
||||
def _request_test_key_download_view(self):
|
||||
return self.get(
|
||||
viewname='django_gpg:key_download', kwargs={'pk': self.test_key_private.pk}
|
||||
viewname='django_gpg:key_download', kwargs={
|
||||
'pk': self.test_key_private.pk
|
||||
}
|
||||
)
|
||||
|
||||
def _request_test_key_upload_view(self):
|
||||
|
||||
@@ -140,7 +140,7 @@ class SignatureTestMixin(object):
|
||||
signature_file=File(file_object)
|
||||
)
|
||||
|
||||
def _create_test_public_key(self):
|
||||
def _create_test_key_public(self):
|
||||
with open(TEST_KEY_FILE_PATH, mode='rb') as file_object:
|
||||
self.test_key_public = Key.objects.create(
|
||||
key_data=file_object.read()
|
||||
|
||||
@@ -47,14 +47,14 @@ class DocumentSignaturesTestCase(SignatureTestMixin, GenericDocumentTestCase):
|
||||
self.assertEqual(signature.key_id, TEST_KEY_PUBLIC_ID)
|
||||
self.assertEqual(signature.signature_id, None)
|
||||
|
||||
self._create_test_public_key()
|
||||
self._create_test_key_public()
|
||||
|
||||
signature = EmbeddedSignature.objects.first()
|
||||
|
||||
self.assertEqual(signature.signature_id, TEST_SIGNATURE_ID)
|
||||
|
||||
def test_embedded_signature_post_no_key_verify(self):
|
||||
self._create_test_public_key()
|
||||
self._create_test_key_public()
|
||||
self.test_document_path = TEST_SIGNED_DOCUMENT_PATH
|
||||
self.upload_document()
|
||||
|
||||
@@ -75,7 +75,7 @@ class DocumentSignaturesTestCase(SignatureTestMixin, GenericDocumentTestCase):
|
||||
self.assertEqual(signature.signature_id, None)
|
||||
|
||||
def test_embedded_signature_with_key(self):
|
||||
self._create_test_public_key()
|
||||
self._create_test_key_public()
|
||||
self.test_document_path = TEST_SIGNED_DOCUMENT_PATH
|
||||
self.upload_document()
|
||||
|
||||
@@ -109,7 +109,7 @@ class DocumentSignaturesTestCase(SignatureTestMixin, GenericDocumentTestCase):
|
||||
self.assertEqual(self.test_signature.public_key_fingerprint, None)
|
||||
|
||||
def test_detached_signature_with_key(self):
|
||||
self._create_test_public_key()
|
||||
self._create_test_key_public()
|
||||
self.test_document_path = TEST_DOCUMENT_PATH
|
||||
self.upload_document()
|
||||
|
||||
@@ -142,7 +142,7 @@ class DocumentSignaturesTestCase(SignatureTestMixin, GenericDocumentTestCase):
|
||||
self.assertEqual(self.test_signature.key_id, TEST_KEY_PUBLIC_ID)
|
||||
self.assertEqual(self.test_signature.public_key_fingerprint, None)
|
||||
|
||||
self._create_test_public_key()
|
||||
self._create_test_key_public()
|
||||
|
||||
signature = DetachedSignature.objects.first()
|
||||
|
||||
@@ -151,7 +151,7 @@ class DocumentSignaturesTestCase(SignatureTestMixin, GenericDocumentTestCase):
|
||||
)
|
||||
|
||||
def test_detached_signature_post_no_key_verify(self):
|
||||
self._create_test_public_key()
|
||||
self._create_test_key_public()
|
||||
self.test_document_path = TEST_DOCUMENT_PATH
|
||||
self.upload_document()
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class SignaturesViewTestCase(
|
||||
auto_upload_document = False
|
||||
|
||||
def test_signature_delete_view_no_permission(self):
|
||||
self._create_test_public_key()
|
||||
self._create_test_key_public()
|
||||
|
||||
self.test_document_path = TEST_DOCUMENT_PATH
|
||||
self.upload_document()
|
||||
@@ -52,7 +52,7 @@ class SignaturesViewTestCase(
|
||||
self.assertEqual(DetachedSignature.objects.count(), 1)
|
||||
|
||||
def test_signature_delete_view_with_access(self):
|
||||
self._create_test_public_key()
|
||||
self._create_test_key_public()
|
||||
|
||||
self.test_document_path = TEST_DOCUMENT_PATH
|
||||
self.upload_document()
|
||||
@@ -73,7 +73,8 @@ class SignaturesViewTestCase(
|
||||
self.assertEqual(DetachedSignature.objects.count(), 0)
|
||||
|
||||
def test_signature_detail_view_no_permission(self):
|
||||
self._create_test_public_key()
|
||||
self._create_test_key_public()
|
||||
|
||||
|
||||
self.test_document_path = TEST_DOCUMENT_PATH
|
||||
self.upload_document()
|
||||
@@ -84,7 +85,7 @@ class SignaturesViewTestCase(
|
||||
self.assertEqual(response.status_code, 404)
|
||||
|
||||
def test_signature_detail_view_with_access(self):
|
||||
self._create_test_public_key()
|
||||
self._create_test_key_public()
|
||||
|
||||
self.test_document_path = TEST_DOCUMENT_PATH
|
||||
self.upload_document()
|
||||
@@ -103,8 +104,7 @@ class SignaturesViewTestCase(
|
||||
)
|
||||
|
||||
def test_signature_list_view_no_permission(self):
|
||||
self._create_test_public_key()
|
||||
|
||||
self._create_test_key_public()
|
||||
self.test_document_path = TEST_DOCUMENT_PATH
|
||||
self.upload_document()
|
||||
|
||||
@@ -116,7 +116,7 @@ class SignaturesViewTestCase(
|
||||
self.assertEqual(response.status_code, 404)
|
||||
|
||||
def test_signature_list_view_with_access(self):
|
||||
self._create_test_public_key()
|
||||
self._create_test_key_public()
|
||||
|
||||
self.test_document_path = TEST_DOCUMENT_PATH
|
||||
self.upload_document()
|
||||
|
||||
@@ -73,6 +73,9 @@ class EventType(object):
|
||||
@classmethod
|
||||
def refresh(cls):
|
||||
for event_type in cls.all():
|
||||
# Invalidate cache and recreate store events while repopulating
|
||||
# cache
|
||||
event_type.stored_event_type = None
|
||||
event_type.get_stored_event_type()
|
||||
|
||||
def __init__(self, namespace, name, label):
|
||||
|
||||
Reference in New Issue
Block a user