Skip to content

Commit

Permalink
Merge pull request #122 from level12/121-head-password-reset
Browse files Browse the repository at this point in the history
Permit HEAD args and kwargs
  • Loading branch information
guruofgentoo committed Apr 20, 2021
2 parents 1a00e9f + 629896f commit 97f8961
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion keg_auth/libs/authenticators.py
Expand Up @@ -114,7 +114,7 @@ def __call__(self, *args, **kwargs):

return resp or self.render()

def head(self):
def head(self, *args, **kwargs):
valid_methods = []
for method in ('get', 'post'):
if hasattr(self, method):
Expand Down
7 changes: 7 additions & 0 deletions keg_auth/tests/test_views.py
Expand Up @@ -300,6 +300,13 @@ def test_reset_pw_template(self):
assert doc('div#page-content a').text() == 'Cancel'
assert doc('div#page-content a').attr('href') == '/login'

def test_reset_pw_head(self):
user = ents.User.testing_create()
token = user.token_generate()

client = flask_webtest.TestApp(flask.current_app)
client.head('/reset-password/{}/{}'.format(user.id, token), status=405)

def test_reset_pw_actions(self):
user = ents.User.testing_create()
token = user.token_generate()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -51,7 +51,7 @@
'email_validator',
'flake8',
'flask-bootstrap',
'flask-jwt-extended',
'flask-jwt-extended<4.0',
'flask-mail',
'flask-oidc',
'flask-webtest',
Expand Down

0 comments on commit 97f8961

Please sign in to comment.