@@ -101,9 +101,13 @@ def __init__(self, *args, **kwargs):
101
101
# Initialize some check values.
102
102
# Initialize these to true. Then the default implementation of each hook function sets to False.
103
103
# Presumably if at least one hook is implemented, then it will stay True.
104
- self ._implemented_auth_setup_hook = True
105
- self ._implemented_pre_assert_hook = True
106
- self ._implemented_post_assert_hook = True
104
+
105
+ class HookClass :
106
+ auth_setup_is_okay = True
107
+ pre_assert_is_okay = True
108
+ post_assert_is_okay = True
109
+
110
+ self .hook_checks = HookClass ()
107
111
108
112
@classmethod
109
113
def setUpClass (cls , * args , debug_print = None , ** kwargs ):
@@ -2141,7 +2145,7 @@ def _assertResponse__pre_builtin_tests(
2141
2145
2142
2146
# Set class variable to track that hook is not implemented.
2143
2147
# Still using the default implementation that does nothing.
2144
- self ._implemented_pre_assert_hook = False
2148
+ self .hook_checks . pre_assert_is_okay = False
2145
2149
2146
2150
def _assertResponse__post_builtin_tests (
2147
2151
self ,
@@ -2180,7 +2184,7 @@ def _assertResponse__post_builtin_tests(
2180
2184
2181
2185
# Set class variable to track that hook is not implemented.
2182
2186
# Still using the default implementation that does nothing.
2183
- self ._implemented_post_assert_hook = False
2187
+ self .hook_checks . post_assert_is_okay = False
2184
2188
2185
2189
def _get_login_user__extra_user_auth_setup (
2186
2190
self ,
@@ -2205,7 +2209,7 @@ def _get_login_user__extra_user_auth_setup(
2205
2209
2206
2210
# Set class variable to track that hook is not implemented.
2207
2211
# Still using the default implementation that does nothing.
2208
- self ._implemented_auth_setup_hook = False
2212
+ self .hook_checks . auth_setup_is_okay = False
2209
2213
2210
2214
return user
2211
2215
@@ -2255,8 +2259,8 @@ def _hook_function_warning_check_if_statement(self, user):
2255
2259
# User is anonymous. Skip auth hook.
2256
2260
if (
2257
2261
# Comment to prevent "black" formatting.
2258
- not self ._implemented_pre_assert_hook
2259
- and not self ._implemented_post_assert_hook
2262
+ not self .hook_checks . pre_assert_is_okay
2263
+ and not self .hook_checks . post_assert_is_okay
2260
2264
):
2261
2265
should_raise_warning = True
2262
2266
@@ -2265,9 +2269,9 @@ def _hook_function_warning_check_if_statement(self, user):
2265
2269
2266
2270
if (
2267
2271
# Comment to prevent "black" formatting.
2268
- not self ._implemented_pre_assert_hook
2269
- and not self ._implemented_post_assert_hook
2270
- and not self ._implemented_auth_setup_hook
2272
+ not self .hook_checks . pre_assert_is_okay
2273
+ and not self .hook_checks . post_assert_is_okay
2274
+ and not self .hook_checks . auth_setup_is_okay
2271
2275
):
2272
2276
should_raise_warning = True
2273
2277
0 commit comments