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
f1a4f77f
Commit
f1a4f77f
authored
Jun 14, 2013
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simple fileadmin test
parent
7b1a999e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
__init__.py
flask_admin/tests/fileadmin/__init__.py
+11
-0
dummy.txt
flask_admin/tests/fileadmin/files/dummy.txt
+0
-0
test_fileadmin.py
flask_admin/tests/fileadmin/test_fileadmin.py
+29
-0
No files found.
flask_admin/tests/fileadmin/__init__.py
0 → 100644
View file @
f1a4f77f
from
flask
import
Flask
from
flask.ext.admin
import
Admin
def
setup
():
app
=
Flask
(
__name__
)
app
.
config
[
'SECRET_KEY'
]
=
'1'
app
.
config
[
'CSRF_ENABLED'
]
=
False
admin
=
Admin
(
app
)
return
app
,
admin
flask_admin/tests/fileadmin/files/dummy.txt
0 → 100644
View file @
f1a4f77f
flask_admin/tests/fileadmin/test_fileadmin.py
0 → 100644
View file @
f1a4f77f
from
nose.tools
import
eq_
,
ok_
import
os.path
as
op
from
flask.ext.admin
import
_compat
from
flask.ext.admin.contrib
import
fileadmin
from
.
import
setup
def
create_view
():
app
,
admin
=
setup
()
path
=
op
.
join
(
op
.
dirname
(
__file__
),
'files'
)
view
=
fileadmin
.
FileAdmin
(
path
,
'/files/'
,
name
=
'Files'
)
admin
.
add_view
(
view
)
return
app
,
admin
,
view
def
test_file_admin
():
app
,
admin
,
view
=
create_view
()
client
=
app
.
test_client
()
rv
=
client
.
get
(
'/admin/fileadmin/'
)
eq_
(
rv
.
status_code
,
200
)
ok_
(
'dummy.txt'
in
_compat
.
as_unicode
(
rv
.
data
))
# TODO: Check actions, etc
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