@@ -535,31 +535,31 @@ def test_get_tokens_on_inactive_app(self):
535535 application .save ()
536536
537537 def test_delete_token_success (self ):
538- anna = self ._create_user (self .test_username , " 123456" , fhir_id_v2 = " 19990000000002" , fhir_id_v3 = " 39990000000002" )
538+ anna = self ._create_user (self .test_username , ' 123456' , fhir_id_v2 = ' 19990000000002' , fhir_id_v3 = ' 39990000000002' )
539539 bob = self ._create_user (
540- " bob" ,
541- " 123456" ,
542- fhir_id_v2 = " 19990000000001" ,
540+ ' bob' ,
541+ ' 123456' ,
542+ fhir_id_v2 = ' 19990000000001' ,
543543 fhir_id_v3 = None ,
544- user_hicn_hash = " 86228a57f37efea543f4f370f96f1dbf01c3e3129041dba3ea4367545507c6e7" ,
545- user_mbi_hash = "98765432137efea543f4f370f96f1dbf01c3e3129041dba3ea4367545507c6e7" ,
544+ user_hicn_hash = ' 86228a57f37efea543f4f370f96f1dbf01c3e3129041dba3ea4367545507c6e7' ,
545+ user_mbi = '1SA0A00AA02' ,
546546 )
547547 # create a couple of capabilities
548548 capability_a = self ._create_capability (
549- " token_management" , [[" DELETE" , r" /v1/o/tokens/\d+/" ]], default = False
549+ ' token_management' , [[' DELETE' , r' /v1/o/tokens/\d+/' ]], default = False
550550 )
551551 # create an application and add capabilities
552552 anna_application = self ._create_application (
553- " an app" ,
553+ ' an app' ,
554554 grant_type = Application .GRANT_AUTHORIZATION_CODE ,
555- redirect_uris = " http://example.it" ,
555+ redirect_uris = ' http://example.it' ,
556556 )
557557 anna_application .scope .add (capability_a )
558558 bob_application = self ._create_application (
559- " another app" ,
559+ ' another app' ,
560560 grant_type = Application .GRANT_IMPLICIT ,
561561 client_type = Application .CLIENT_PUBLIC ,
562- redirect_uris = " http://example.it" ,
562+ redirect_uris = ' http://example.it' ,
563563 user = anna_application .user ,
564564 )
565565 bob_application .scope .add (capability_a )
@@ -579,10 +579,10 @@ def test_delete_token_success(self):
579579 # Post Django 2.2: An OSError exception is expected when trying to reach the
580580 # backend FHIR server and proves authentication worked.
581581 with self .assertRaisesRegexp (
582- OSError , " Could not find the TLS certificate file"
582+ OSError , ' Could not find the TLS certificate file'
583583 ):
584584 response = self .client .get (
585- " /v1/fhir/Patient" , headers = {" authorization" : " Bearer " + anna_token .token }
585+ ' /v1/fhir/Patient' , headers = {' authorization' : ' Bearer ' + anna_token .token }
586586 )
587587
588588 bob_tkn = self ._create_test_token (bob , bob_application )
@@ -594,12 +594,12 @@ def test_delete_token_success(self):
594594 )
595595
596596 response = self .client .get (
597- reverse (" token_management:token-list" ),
597+ reverse (' token_management:token-list' ),
598598 headers = {
599- " authorization" : self ._create_authorization_header (
599+ ' authorization' : self ._create_authorization_header (
600600 anna_application .client_id , anna_application .client_secret_plain
601601 ),
602- " x-authentication" : self ._create_authentication_header (self .test_uuid ),
602+ ' x-authentication' : self ._create_authentication_header (self .test_uuid ),
603603 },
604604 )
605605 grant_list = response .json ()
@@ -609,21 +609,21 @@ def test_delete_token_success(self):
609609 )
610610 http_authn = self ._create_authentication_header (self .test_uuid )
611611 response = self .client .delete (
612- reverse (" token_management:token-detail" , args = [grant_list [0 ]["id" ]]),
613- headers = {" authorization" : http_authz , " x-authentication" : http_authn },
612+ reverse (' token_management:token-detail' , args = [grant_list [0 ]['id' ]]),
613+ headers = {' authorization' : http_authz , ' x-authentication' : http_authn },
614614 )
615615 self .assertEqual (response .status_code , 204 )
616- url_1 = reverse (" token_management:token-detail" , args = [grant_list [0 ]["id" ]])
616+ url_1 = reverse (' token_management:token-detail' , args = [grant_list [0 ]['id' ]])
617617 http_authz = self ._create_authorization_header (
618618 anna_application .client_id , anna_application .client_secret_plain
619619 )
620620 http_authn = self ._create_authentication_header (self .test_uuid )
621621 failed_response = self .client .delete (
622- url_1 , headers = {" authorization" : http_authz , " x-authentication" : http_authn }
622+ url_1 , headers = {' authorization' : http_authz , ' x-authentication' : http_authn }
623623 )
624624 self .assertEqual (failed_response .status_code , 404 )
625625 response = self .client .get (
626- " /v1/fhir/Patient" , headers = {" authorization" : " Bearer " + anna_token .token }
626+ ' /v1/fhir/Patient' , headers = {' authorization' : ' Bearer ' + anna_token .token }
627627 )
628628 self .assertEqual (response .status_code , 401 )
629629
@@ -637,22 +637,22 @@ def test_delete_token_success(self):
637637 # Post Django 2.2: An OSError exception is expected when trying to reach the
638638 # backend FHIR server and proves authentication worked.
639639 with self .assertRaisesRegexp (
640- OSError , " Could not find the TLS certificate file"
640+ OSError , ' Could not find the TLS certificate file'
641641 ):
642642 response = self .client .get (
643- " /v1/fhir/Patient" , headers = {" authorization" : " Bearer " + bob_tkn .token }
643+ ' /v1/fhir/Patient' , headers = {' authorization' : ' Bearer ' + bob_tkn .token }
644644 )
645645
646646 next_tkn = self ._create_test_token (anna , anna_application )
647647
648648 # Post Django 2.2: An OSError exception is expected when trying to reach the
649649 # backend FHIR server and proves authentication worked.
650650 with self .assertRaisesRegexp (
651- OSError , " Could not find the TLS certificate file"
651+ OSError , ' Could not find the TLS certificate file'
652652 ):
653653 response = self .client .get (
654- " /v1/fhir/Patient" ,
655- headers = {" authorization" : " Bearer " + next_tkn .token },
654+ ' /v1/fhir/Patient' ,
655+ headers = {' authorization' : ' Bearer ' + next_tkn .token },
656656 )
657657
658658 # self.assertEqual(next_tkn.token, tkn.token)
0 commit comments