Skip to content

Commit

Permalink
- Added a comprehensive integration test suite for repoze.what & rep…
Browse files Browse the repository at this point in the history
…oze.what-pylons (26 tests!).

 - Removed unnecessary auth* tests.
 - Slightly improved @require's denial handler, thanks to the results from the new tests.
 - Updated dependencies for these tests.

Note that four of them are failing because of #2262.

--HG--
extra : convert_revision : svn%3A77541ad4-5f01-0410-9ede-a1b63cd9a898/trunk%406491
  • Loading branch information
Gustavo committed Mar 8, 2009
1 parent b26703c commit 723630f
Show file tree
Hide file tree
Showing 4 changed files with 404 additions and 54 deletions.
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
'zope.sqlalchemy',
'jinja',
'chameleon.genshi',
'repoze.what >= 1.0.5',
'repoze.who-testutil >= 1.0rc1',
]

setup(
Expand Down
4 changes: 2 additions & 2 deletions tg/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,13 +545,13 @@ class require(ActionProtector):

def default_denial_handler(self, reason):
"""Authorization denial handler for repoze.what-pylons protectors."""
if response.status.startswith('401'):
if response.status_int == 401:
status = 'warning'
else:
# Status is a 403
status = 'error'
flash(reason, status=status)
abort(response.status_int, comment=reason)
abort(response.status_int, reason)


class allow_only(ControllerProtector):
Expand Down
Loading

0 comments on commit 723630f

Please sign in to comment.