示例#1
0
 def test_logout_url_options_uses_options_over_api(self):
     custom_api = Api(mode="sandbox",
                      client_id='custom_client_id',
                      client_secret='custom_client_secret',
                      openid_endpoint='https://def.abc',
                      openid_redirect_uri='http://abc.def/')
     url = logout_url({'id_token': '1234'}, api=custom_api)
     assert_regex_matches(self, url, 'id_token=1234')
示例#2
0
 def test_logout_url_with_api(self):
     custom_api = Api(mode="sandbox",
                      client_id='custom_client_id',
                      client_secret='custom_client_secret',
                      openid_endpoint='https://def.abc',
                      openid_redirect_uri='http://abc.def/')
     url = logout_url(api=custom_api)
     assert_regex_matches(self, url, 'logout=true')
     assert_regex_matches(self, url, 'redirect_uri=http%3A%2F%2Fabc.def%2F')
  def test_authorize_url(self):
    url = authorize_url()
    assert_regex_matches(self, url, 'response_type=code')
    assert_regex_matches(self, url, 'scope=openid')
    assert_regex_matches(self, url, 'client_id=%s'%(client_id))
    assert_regex_matches(self, url, 'https://www.sandbox.paypal.com')

    self.assertEqual(endpoint(), 'https://api.sandbox.paypal.com')
示例#4
0
    def test_authorize_url(self):
        url = authorize_url()
        assert_regex_matches(self, url, 'response_type=code')
        assert_regex_matches(self, url, 'scope=openid')
        assert_regex_matches(self, url, 'client_id=%s' % (client_id))
        assert_regex_matches(self, url, 'https://www.sandbox.paypal.com')

        self.assertEqual(endpoint(), 'https://api.sandbox.paypal.com')
  def test_live_mode_url(self):
    try:
      paypal.configure( mode='live',  client_id=client_id, client_secret=client_secret )
      url = authorize_url()
      assert_regex_matches(self, url, 'response_type=code')
      assert_regex_matches(self, url, 'scope=openid')
      assert_regex_matches(self, url, 'client_id=%s'%(client_id))
      assert_regex_matches(self, url, 'https://www.paypal.com')

      self.assertEqual(endpoint(), 'https://api.paypal.com')
    finally:
      paypal.configure( mode='sandbox', client_id=client_id, client_secret=client_secret )
示例#6
0
    def test_authorize_url_with_api(self):
        custom_api = Api(mode="sandbox",
                         client_id='custom_client_id',
                         client_secret='custom_client_secret',
                         openid_endpoint='https://def.abc',
                         openid_redirect_uri='http://abc.def/')
        url = authorize_url(api=custom_api)
        assert_regex_matches(self, url, 'response_type=code')
        assert_regex_matches(self, url, 'scope=openid')
        assert_regex_matches(self, url, 'client_id=custom_client_id')
        assert_regex_matches(self, url, 'redirect_uri=http%3A%2F%2Fabc.def%2F')

        self.assertEqual(endpoint(custom_api), 'https://def.abc')
示例#7
0
    def test_live_mode_url(self):
        try:
            paypal.configure(
                mode='live', client_id=client_id, client_secret=client_secret)
            url = authorize_url()
            assert_regex_matches(self, url, 'response_type=code')
            assert_regex_matches(self, url, 'scope=openid')
            assert_regex_matches(self, url, 'client_id=%s' % (client_id))
            assert_regex_matches(self, url, 'https://www.paypal.com')

            self.assertEqual(endpoint(), 'https://api.paypal.com')
        finally:
            paypal.configure(
                mode='sandbox', client_id=client_id, client_secret=client_secret)
 def test_authorize_url_options(self):
   url = authorize_url({ 'scope': 'openid profile' })
   assert_regex_matches(self, url, 'scope=openid\+profile')
示例#9
0
 def test_authorize_url_options(self):
     url = authorize_url({'scope': 'openid profile'})
     assert_regex_matches(self, url, 'scope=openid\+profile')
 def test_logout_url_options(self):
   url = logout_url({'id_token': '1234'})
   assert_regex_matches(self, url, 'id_token=1234')
示例#11
0
 def test_logout_url(self):
     url = logout_url()
     assert_regex_matches(self, url, 'logout=true')
示例#12
0
 def test_authorize_url_using_tokeninfo(self):
     url = Tokeninfo.authorize_url({'scope': 'openid profile'})
     assert_regex_matches(self, url, 'scope=openid\+profile')
 def test_authorize_url(self):
     url = authorize_url()
     assert_regex_matches(self, url, 'response_type=code')
     assert_regex_matches(self, url, 'scope=openid')
     assert_regex_matches(self, url, 'client_id=%s' % (client_id))
 def test_authorize_url_using_tokeninfo(self):
   url = Tokeninfo.authorize_url({ 'scope': 'openid profile' })
   assert_regex_matches(self, url, 'scope=openid\+profile')
示例#15
0
 def test_logout_url_options(self):
     url = logout_url({'id_token': '1234'})
     assert_regex_matches(self, url, 'id_token=1234')
 def test_logout_url(self):
   url = logout_url()
   assert_regex_matches(self, url, 'logout=true')
示例#17
0
 def test_logout_url_using_tokeninfo(self):
     url = Tokeninfo({'id_token': '1234'}).logout_url()
     assert_regex_matches(self, url, 'id_token=1234')
 def test_logout_url_using_tokeninfo(self):
   url = Tokeninfo({'id_token': '1234'}).logout_url()
   assert_regex_matches(self, url, 'id_token=1234')
 def test_authorize_url(self):
   url = authorize_url()
   assert_regex_matches(self, url, 'response_type=code')
   assert_regex_matches(self, url, 'scope=openid')
   assert_regex_matches(self, url, 'client_id=%s'%(client_id))