Revised the test_stale_opaque tests of the AuthenticationTestCase and FlaskLoginTestCase test cases to use the super method instead of the overridden method of the Client class.
This commit is contained in:
parent
177f549786
commit
dda8472a76
@ -118,7 +118,7 @@ class AuthenticationTestCase(TestCase):
|
|||||||
www_authenticate: WWWAuthenticate
|
www_authenticate: WWWAuthenticate
|
||||||
auth_data: Authorization
|
auth_data: Authorization
|
||||||
|
|
||||||
response = self.client.get(admin_uri)
|
response = super(Client, self.client).get(admin_uri)
|
||||||
self.assertEqual(response.status_code, 401)
|
self.assertEqual(response.status_code, 401)
|
||||||
www_authenticate = response.www_authenticate
|
www_authenticate = response.www_authenticate
|
||||||
self.assertEqual(www_authenticate.type, "digest")
|
self.assertEqual(www_authenticate.type, "digest")
|
||||||
@ -128,7 +128,7 @@ class AuthenticationTestCase(TestCase):
|
|||||||
www_authenticate.nonce = "bad"
|
www_authenticate.nonce = "bad"
|
||||||
auth_data = Client.make_authorization(
|
auth_data = Client.make_authorization(
|
||||||
www_authenticate, admin_uri, _USERNAME, _PASSWORD)
|
www_authenticate, admin_uri, _USERNAME, _PASSWORD)
|
||||||
response = self.client.get(admin_uri, auth=auth_data)
|
response = super(Client, self.client).get(admin_uri, auth=auth_data)
|
||||||
self.assertEqual(response.status_code, 401)
|
self.assertEqual(response.status_code, 401)
|
||||||
www_authenticate = response.www_authenticate
|
www_authenticate = response.www_authenticate
|
||||||
self.assertEqual(www_authenticate.stale, True)
|
self.assertEqual(www_authenticate.stale, True)
|
||||||
@ -136,7 +136,7 @@ class AuthenticationTestCase(TestCase):
|
|||||||
|
|
||||||
auth_data = Client.make_authorization(
|
auth_data = Client.make_authorization(
|
||||||
www_authenticate, admin_uri, _USERNAME, _PASSWORD + "2")
|
www_authenticate, admin_uri, _USERNAME, _PASSWORD + "2")
|
||||||
response = self.client.get(admin_uri, auth=auth_data)
|
response = super(Client, self.client).get(admin_uri, auth=auth_data)
|
||||||
self.assertEqual(response.status_code, 401)
|
self.assertEqual(response.status_code, 401)
|
||||||
www_authenticate = response.www_authenticate
|
www_authenticate = response.www_authenticate
|
||||||
self.assertEqual(www_authenticate.stale, False)
|
self.assertEqual(www_authenticate.stale, False)
|
||||||
@ -144,5 +144,5 @@ class AuthenticationTestCase(TestCase):
|
|||||||
|
|
||||||
auth_data = Client.make_authorization(
|
auth_data = Client.make_authorization(
|
||||||
www_authenticate, admin_uri, _USERNAME, _PASSWORD)
|
www_authenticate, admin_uri, _USERNAME, _PASSWORD)
|
||||||
response = self.client.get(admin_uri, auth=auth_data)
|
response = super(Client, self.client).get(admin_uri, auth=auth_data)
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
@ -156,7 +156,7 @@ class FlaskLoginTestCase(TestCase):
|
|||||||
www_authenticate: WWWAuthenticate
|
www_authenticate: WWWAuthenticate
|
||||||
auth_data: Authorization
|
auth_data: Authorization
|
||||||
|
|
||||||
response = self.client.get(admin_uri)
|
response = super(Client, self.client).get(admin_uri)
|
||||||
self.assertEqual(response.status_code, 401)
|
self.assertEqual(response.status_code, 401)
|
||||||
www_authenticate = response.www_authenticate
|
www_authenticate = response.www_authenticate
|
||||||
self.assertEqual(www_authenticate.type, "digest")
|
self.assertEqual(www_authenticate.type, "digest")
|
||||||
@ -168,7 +168,7 @@ class FlaskLoginTestCase(TestCase):
|
|||||||
www_authenticate.nonce = "bad"
|
www_authenticate.nonce = "bad"
|
||||||
auth_data = Client.make_authorization(
|
auth_data = Client.make_authorization(
|
||||||
www_authenticate, admin_uri, _USERNAME, _PASSWORD)
|
www_authenticate, admin_uri, _USERNAME, _PASSWORD)
|
||||||
response = self.client.get(admin_uri, auth=auth_data)
|
response = super(Client, self.client).get(admin_uri, auth=auth_data)
|
||||||
self.assertEqual(response.status_code, 401)
|
self.assertEqual(response.status_code, 401)
|
||||||
www_authenticate = response.www_authenticate
|
www_authenticate = response.www_authenticate
|
||||||
self.assertEqual(www_authenticate.stale, True)
|
self.assertEqual(www_authenticate.stale, True)
|
||||||
@ -178,7 +178,7 @@ class FlaskLoginTestCase(TestCase):
|
|||||||
delattr(g, "_login_user")
|
delattr(g, "_login_user")
|
||||||
auth_data = Client.make_authorization(
|
auth_data = Client.make_authorization(
|
||||||
www_authenticate, admin_uri, _USERNAME, _PASSWORD + "2")
|
www_authenticate, admin_uri, _USERNAME, _PASSWORD + "2")
|
||||||
response = self.client.get(admin_uri, auth=auth_data)
|
response = super(Client, self.client).get(admin_uri, auth=auth_data)
|
||||||
self.assertEqual(response.status_code, 401)
|
self.assertEqual(response.status_code, 401)
|
||||||
www_authenticate = response.www_authenticate
|
www_authenticate = response.www_authenticate
|
||||||
self.assertEqual(www_authenticate.stale, False)
|
self.assertEqual(www_authenticate.stale, False)
|
||||||
@ -188,5 +188,5 @@ class FlaskLoginTestCase(TestCase):
|
|||||||
delattr(g, "_login_user")
|
delattr(g, "_login_user")
|
||||||
auth_data = Client.make_authorization(
|
auth_data = Client.make_authorization(
|
||||||
www_authenticate, admin_uri, _USERNAME, _PASSWORD)
|
www_authenticate, admin_uri, _USERNAME, _PASSWORD)
|
||||||
response = self.client.get(admin_uri, auth=auth_data)
|
response = super(Client, self.client).get(admin_uri, auth=auth_data)
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
Loading…
Reference in New Issue
Block a user