File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
openwisp_controller/pki/tests Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1+ from cryptography import x509
2+ from cryptography .hazmat .backends import default_backend
13from django .core .exceptions import ValidationError
24from django .test import TestCase
35from django .urls import reverse
4- from OpenSSL import crypto
56from swapper import load_model
67
78from openwisp_controller .tests .utils import TestAdminMixin
@@ -51,9 +52,9 @@ def test_crl_view(self):
5152 ca = self ._create_ca ()
5253 response = self .client .get (reverse ("admin:crl" , args = [ca .pk ]))
5354 self .assertEqual (response .status_code , 200 )
54- crl = crypto . load_crl ( crypto . FILETYPE_PEM , response .content )
55- revoked_list = crl . get_revoked ()
56- self .assertIsNone (revoked_list )
55+ crl = x509 . load_pem_x509_crl ( response .content , default_backend () )
56+ revoked_list = [ cert for cert in crl ]
57+ self .assertEqual (revoked_list , [] )
5758
5859 def test_unique_together_org_none (self ):
5960 ca = self ._create_ca (organization = None , common_name = "common_name" )
You can’t perform that action at this time.
0 commit comments