def METHOD_NAME(self, context):
    """
    Tests start of authentication (incoming auth req) and receiving auth
    response.
    """
    responses.add(responses.POST,
                  BB_CONFIG["server_info"]["token_endpoint"],
                  body=json.dumps({"access_token": "qwerty",
                                   "token_type": "bearer",
                                   "expires_in": 9999999999999}),
                  status=200,
                  content_type='application/json')
    self.setup_bitbucket_response()
    context.path = 'bitbucket/sso/redirect'
    internal_request = InternalData(
        subject_type=NAMEID_FORMAT_TRANSIENT, requester='test_requester'
    )
    self.bb_backend.start_auth(context, internal_request, mock_get_state)
    context.request = {
        "code": BB_RESPONSE_CODE,
        "state": mock_get_state.return_value
    }
    self.bb_backend._authn_response(context)
    self.assert_expected_attributes()