@@ -2109,42 +2109,6 @@ def test_refresh_patron_access_token(
21092109 assert "false" == payload ["password_required" ]
21102110 assert "[ignore]" == payload ["password" ]
21112111
2112- def test_refresh_patron_access_token_is_fulfillment (
2113- self , overdrive_api_fixture : OverdriveAPIFixture
2114- ):
2115- """Verify that patron information is included in the request
2116- when refreshing a patron access token.
2117- """
2118- db = overdrive_api_fixture .db
2119- patron = db .patron ()
2120- patron .authorization_identifier = "barcode"
2121- credential = db .credential (patron = patron )
2122-
2123- # Mocked testing credentials
2124- encoded_auth = base64 .b64encode (b"TestingKey:TestingSecret" )
2125-
2126- # use a real Overdrive API
2127- od_api = OverdriveAPI (db .session , overdrive_api_fixture .collection )
2128- od_api ._server_nickname = OverdriveConstants .TESTING_SERVERS
2129- # but mock the request methods
2130- od_api ._do_post = MagicMock ()
2131- od_api ._do_get = MagicMock ()
2132- response_credential = od_api .refresh_patron_access_token (
2133- credential , patron , "a pin" , is_fulfillment = True
2134- )
2135-
2136- # Posted once, no gets
2137- od_api ._do_post .assert_called_once ()
2138- od_api ._do_get .assert_not_called ()
2139-
2140- # What did we Post?
2141- call_args = od_api ._do_post .call_args [0 ]
2142- assert "/patrontoken" in call_args [0 ] # url
2143- assert (
2144- call_args [2 ]["Authorization" ] == f"Basic { encoded_auth .decode ()} "
2145- ) # Basic header should be that of the fulfillment keys
2146- assert response_credential == credential
2147-
21482112 def test_cannot_fulfill_error_audiobook (
21492113 self , overdrive_api_fixture : OverdriveAPIFixture
21502114 ):
0 commit comments