From dda8472a76a8d607cd3ca4143e961f4b29c2d230 Mon Sep 17 00:00:00 2001 From: imacat Date: Fri, 25 Nov 2022 00:18:43 +1100 Subject: [PATCH] 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. --- tests/test_auth.py | 8 ++++---- tests/test_flask_login.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_auth.py b/tests/test_auth.py index 55ba97e..8d4ebf9 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -118,7 +118,7 @@ class AuthenticationTestCase(TestCase): www_authenticate: WWWAuthenticate auth_data: Authorization - response = self.client.get(admin_uri) + response = super(Client, self.client).get(admin_uri) self.assertEqual(response.status_code, 401) www_authenticate = response.www_authenticate self.assertEqual(www_authenticate.type, "digest") @@ -128,7 +128,7 @@ class AuthenticationTestCase(TestCase): www_authenticate.nonce = "bad" auth_data = Client.make_authorization( 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) www_authenticate = response.www_authenticate self.assertEqual(www_authenticate.stale, True) @@ -136,7 +136,7 @@ class AuthenticationTestCase(TestCase): auth_data = Client.make_authorization( 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) www_authenticate = response.www_authenticate self.assertEqual(www_authenticate.stale, False) @@ -144,5 +144,5 @@ class AuthenticationTestCase(TestCase): auth_data = Client.make_authorization( 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) diff --git a/tests/test_flask_login.py b/tests/test_flask_login.py index 5bb8b7a..4551c41 100644 --- a/tests/test_flask_login.py +++ b/tests/test_flask_login.py @@ -156,7 +156,7 @@ class FlaskLoginTestCase(TestCase): www_authenticate: WWWAuthenticate auth_data: Authorization - response = self.client.get(admin_uri) + response = super(Client, self.client).get(admin_uri) self.assertEqual(response.status_code, 401) www_authenticate = response.www_authenticate self.assertEqual(www_authenticate.type, "digest") @@ -168,7 +168,7 @@ class FlaskLoginTestCase(TestCase): www_authenticate.nonce = "bad" auth_data = Client.make_authorization( 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) www_authenticate = response.www_authenticate self.assertEqual(www_authenticate.stale, True) @@ -178,7 +178,7 @@ class FlaskLoginTestCase(TestCase): delattr(g, "_login_user") auth_data = Client.make_authorization( 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) www_authenticate = response.www_authenticate self.assertEqual(www_authenticate.stale, False) @@ -188,5 +188,5 @@ class FlaskLoginTestCase(TestCase): delattr(g, "_login_user") auth_data = Client.make_authorization( 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)