Skip to content

Commit

Permalink
Merge dd447c8 into d02eb86
Browse files Browse the repository at this point in the history
  • Loading branch information
mgraupner committed Jan 9, 2017
2 parents d02eb86 + dd447c8 commit 23ec8c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions flask_wtf/csrf.py
Expand Up @@ -299,11 +299,11 @@ def error_handler(self, view):
.. deprecated:: 0.14
Use the standard Flask error system with
``@app.errorhandler(CsrfError)`` instead. This will be removed in
``@app.errorhandler(CSRFError)`` instead. This will be removed in
version 1.0.
The function will be passed one argument, ``reason``. By default it will
raise a :class:`~flask_wtf.csrf.CsrfError`. ::
raise a :class:`~flask_wtf.csrf.CSRFError`. ::
@csrf.error_handler
def csrf_error(reason):
Expand All @@ -315,7 +315,7 @@ def csrf_error(reason):

warnings.warn(FlaskWTFDeprecationWarning(
'"@csrf.error_handler" is deprecated. Use the standard Flask error '
'system with "@app.errorhandler(CsrfError)" instead. This will be'
'system with "@app.errorhandler(CSRFError)" instead. This will be'
'removed in 1.0.'
), stacklevel=2)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_csrf.py
Expand Up @@ -301,7 +301,7 @@ def handle_csrf_error(reason):

self.assertEqual(len(w), 1)
assert issubclass(w[0].category, FlaskWTFDeprecationWarning)
assert 'app.errorhandler(CsrfError)' in str(w[0].message)
assert 'app.errorhandler(CSRFError)' in str(w[0].message)

rv = self.client.post('/', data={'name': 'david'})
assert b'caught csrf return' in rv.data
Expand All @@ -315,7 +315,7 @@ def handle_csrf_error(reason):

self.assertEqual(len(w), 1)
assert issubclass(w[0].category, FlaskWTFDeprecationWarning)
assert 'app.errorhandler(CsrfError)' in str(w[0].message)
assert 'app.errorhandler(CSRFError)' in str(w[0].message)

rv = self.client.post('/', data={'name': 'david'})
assert b'caught csrf abort' in rv.data

0 comments on commit 23ec8c6

Please sign in to comment.