Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
1eb349d3
Commit
1eb349d3
authored
Jun 01, 2014
by
Iuri de Silvio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test `inaccessible_callback` with a custom error code.
parent
77dcf582
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
test_base.py
flask_admin/tests/test_base.py
+15
-1
No files found.
flask_admin/tests/test_base.py
View file @
1eb349d3
from
nose.tools
import
ok_
,
eq_
,
raises
from
nose.tools
import
ok_
,
eq_
,
raises
from
flask
import
Flask
,
request
from
flask
import
Flask
,
request
,
abort
from
flask.views
import
MethodView
from
flask.views
import
MethodView
from
flask.ext.admin
import
base
from
flask.ext.admin
import
base
...
@@ -232,6 +232,20 @@ def test_permissions():
...
@@ -232,6 +232,20 @@ def test_permissions():
eq_
(
rv
.
status_code
,
403
)
eq_
(
rv
.
status_code
,
403
)
def
test_inaccessible_callback
():
app
=
Flask
(
__name__
)
admin
=
base
.
Admin
(
app
)
view
=
MockView
()
admin
.
add_view
(
view
)
client
=
app
.
test_client
()
view
.
allow_access
=
False
view
.
inaccessible_callback
=
lambda
*
args
,
**
kwargs
:
abort
(
418
)
rv
=
client
.
get
(
'/admin/mockview/'
)
eq_
(
rv
.
status_code
,
418
)
def
get_visibility
():
def
get_visibility
():
app
=
Flask
(
__name__
)
app
=
Flask
(
__name__
)
admin
=
base
.
Admin
(
app
)
admin
=
base
.
Admin
(
app
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment