summaryrefslogtreecommitdiff
path: root/tests/oauth2
diff options
context:
space:
mode:
Diffstat (limited to 'tests/oauth2')
-rw-r--r--tests/oauth2/rfc6749/clients/test_backend_application.py1
-rw-r--r--tests/oauth2/rfc6749/clients/test_base.py35
-rw-r--r--tests/oauth2/rfc6749/clients/test_legacy_application.py1
-rw-r--r--tests/oauth2/rfc6749/clients/test_mobile_application.py1
-rw-r--r--tests/oauth2/rfc6749/clients/test_service_application.py3
-rw-r--r--tests/oauth2/rfc6749/clients/test_web_application.py1
-rw-r--r--tests/oauth2/rfc6749/test_parameters.py4
7 files changed, 1 insertions, 45 deletions
diff --git a/tests/oauth2/rfc6749/clients/test_backend_application.py b/tests/oauth2/rfc6749/clients/test_backend_application.py
index aa2ba2b..b17564b 100644
--- a/tests/oauth2/rfc6749/clients/test_backend_application.py
+++ b/tests/oauth2/rfc6749/clients/test_backend_application.py
@@ -36,7 +36,6 @@ class BackendApplicationClientTest(TestCase):
"access_token": "2YotnFZFEjr1zCsicMWpAA",
"token_type": "example",
"expires_in": 3600,
- "expires_at": 4600,
"scope": ["/profile"],
"example_parameter": "example_value"
}
diff --git a/tests/oauth2/rfc6749/clients/test_base.py b/tests/oauth2/rfc6749/clients/test_base.py
index d48a944..a9144ce 100644
--- a/tests/oauth2/rfc6749/clients/test_base.py
+++ b/tests/oauth2/rfc6749/clients/test_base.py
@@ -4,7 +4,7 @@ from __future__ import absolute_import, unicode_literals
import datetime
from oauthlib import common
-from oauthlib.oauth2 import Client, InsecureTransportError, TokenExpiredError
+from oauthlib.oauth2 import Client, InsecureTransportError
from oauthlib.oauth2.rfc6749 import utils
from oauthlib.oauth2.rfc6749.clients import AUTH_HEADER, BODY, URI_QUERY
@@ -62,15 +62,6 @@ class ClientTest(TestCase):
client = Client(self.client_id)
self.assertRaises(ValueError, client.add_token, self.uri)
- # Expired token
- expired = 523549800
- expired_token = {
- 'expires_at': expired,
- }
- client = Client(self.client_id, token=expired_token, access_token=self.access_token, token_type="Bearer")
- self.assertRaises(TokenExpiredError, client.add_token, self.uri,
- body=self.body, headers=self.headers)
-
# The default token placement, bearer in auth header
client = Client(self.client_id, access_token=self.access_token)
uri, headers, body = client.add_token(self.uri, body=self.body,
@@ -172,18 +163,6 @@ class ClientTest(TestCase):
body=self.body,
headers=self.headers,
issue_time=datetime.datetime.now())
- # Expired Token
- expired = 523549800
- expired_token = {
- 'expires_at': expired,
- }
- client = Client(self.client_id, token=expired_token, token_type="MAC",
- access_token=self.access_token, mac_key=self.mac_key,
- mac_algorithm="hmac-sha-1")
- self.assertRaises(TokenExpiredError, client.add_token, self.uri,
- body=self.body,
- headers=self.headers,
- issue_time=datetime.datetime.now())
# Add the Authorization header (draft 01)
client = Client(self.client_id, token_type="MAC",
@@ -200,18 +179,6 @@ class ClientTest(TestCase):
body=self.body,
headers=self.headers,
draft=1)
- # Expired Token
- expired = 523549800
- expired_token = {
- 'expires_at': expired,
- }
- client = Client(self.client_id, token=expired_token, token_type="MAC",
- access_token=self.access_token, mac_key=self.mac_key,
- mac_algorithm="hmac-sha-1")
- self.assertRaises(TokenExpiredError, client.add_token, self.uri,
- body=self.body,
- headers=self.headers,
- draft=1)
def test_revocation_request(self):
client = Client(self.client_id)
diff --git a/tests/oauth2/rfc6749/clients/test_legacy_application.py b/tests/oauth2/rfc6749/clients/test_legacy_application.py
index 21af4a3..c914572 100644
--- a/tests/oauth2/rfc6749/clients/test_legacy_application.py
+++ b/tests/oauth2/rfc6749/clients/test_legacy_application.py
@@ -45,7 +45,6 @@ class LegacyApplicationClientTest(TestCase):
"access_token": "2YotnFZFEjr1zCsicMWpAA",
"token_type": "example",
"expires_in": 3600,
- "expires_at": 4600,
"scope": scope,
"refresh_token": "tGzv3JOkF0XG5Qx2TlKWIA",
"example_parameter": "example_value"
diff --git a/tests/oauth2/rfc6749/clients/test_mobile_application.py b/tests/oauth2/rfc6749/clients/test_mobile_application.py
index 622b275..8782a7b 100644
--- a/tests/oauth2/rfc6749/clients/test_mobile_application.py
+++ b/tests/oauth2/rfc6749/clients/test_mobile_application.py
@@ -41,7 +41,6 @@ class MobileApplicationClientTest(TestCase):
"access_token": "2YotnFZFEjr1zCsicMWpAA",
"token_type": "example",
"expires_in": 3600,
- "expires_at": 4600,
"scope": scope,
"example_parameter": "example_value"
}
diff --git a/tests/oauth2/rfc6749/clients/test_service_application.py b/tests/oauth2/rfc6749/clients/test_service_application.py
index dc337cf..725494b 100644
--- a/tests/oauth2/rfc6749/clients/test_service_application.py
+++ b/tests/oauth2/rfc6749/clients/test_service_application.py
@@ -78,7 +78,6 @@ mfvGGg3xNjTMO7IdrwIDAQAB
@patch('time.time')
def test_request_body(self, t):
t.return_value = time()
- self.token['expires_at'] = self.token['expires_in'] + t.return_value
client = ServiceApplicationClient(
self.client_id, private_key=self.private_key)
@@ -139,7 +138,6 @@ mfvGGg3xNjTMO7IdrwIDAQAB
@patch('time.time')
def test_request_body_no_initial_private_key(self, t):
t.return_value = time()
- self.token['expires_at'] = self.token['expires_in'] + t.return_value
client = ServiceApplicationClient(
self.client_id, private_key=None)
@@ -168,7 +166,6 @@ mfvGGg3xNjTMO7IdrwIDAQAB
@patch('time.time')
def test_parse_token_response(self, t):
t.return_value = time()
- self.token['expires_at'] = self.token['expires_in'] + t.return_value
client = ServiceApplicationClient(self.client_id)
diff --git a/tests/oauth2/rfc6749/clients/test_web_application.py b/tests/oauth2/rfc6749/clients/test_web_application.py
index 092f93e..a6699cb 100644
--- a/tests/oauth2/rfc6749/clients/test_web_application.py
+++ b/tests/oauth2/rfc6749/clients/test_web_application.py
@@ -63,7 +63,6 @@ class WebApplicationClientTest(TestCase):
"access_token": "2YotnFZFEjr1zCsicMWpAA",
"token_type": "example",
"expires_in": 3600,
- "expires_at": 4600,
"scope": scope,
"refresh_token": "tGzv3JOkF0XG5Qx2TlKWIA",
"example_parameter": "example_value"
diff --git a/tests/oauth2/rfc6749/test_parameters.py b/tests/oauth2/rfc6749/test_parameters.py
index c42f516..64dfa11 100644
--- a/tests/oauth2/rfc6749/test_parameters.py
+++ b/tests/oauth2/rfc6749/test_parameters.py
@@ -87,7 +87,6 @@ class ParameterTests(TestCase):
'state': state,
'token_type': 'example',
'expires_in': 3600,
- 'expires_at': 4600,
'scope': ['abc']
}
@@ -120,7 +119,6 @@ class ParameterTests(TestCase):
'access_token': '2YotnFZFEjr1zCsicMWpAA',
'token_type': 'example',
'expires_in': 3600,
- 'expires_at': 4600,
'refresh_token': 'tGzv3JOkF0XG5Qx2TlKWIA',
'example_parameter': 'example_value',
'scope': ['abc', 'def']
@@ -130,7 +128,6 @@ class ParameterTests(TestCase):
'access_token': '2YotnFZFEjr1zCsicMWpAA',
'token_type': 'example',
'expires_in': 3600,
- 'expires_at': 4600,
'refresh_token': 'tGzv3JOkF0XG5Qx2TlKWIA',
'example_parameter': 'example_value'
}
@@ -138,7 +135,6 @@ class ParameterTests(TestCase):
json_notype_dict = {
'access_token': '2YotnFZFEjr1zCsicMWpAA',
'expires_in': 3600,
- 'expires_at': 4600,
'refresh_token': 'tGzv3JOkF0XG5Qx2TlKWIA',
'example_parameter': 'example_value',
}