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
4e3d2847
Commit
4e3d2847
authored
Jul 01, 2019
by
P.J. Janse van Rensburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test extra arg propagation
parent
5a995cab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
test_basic.py
flask_admin/tests/sqla/test_basic.py
+41
-0
No files found.
flask_admin/tests/sqla/test_basic.py
View file @
4e3d2847
...
...
@@ -436,6 +436,47 @@ def test_column_searchable_list():
ok_
(
'model2-test'
in
data
)
def
test_extra_args_search
():
app
,
db
,
admin
=
setup
()
Model1
,
Model2
=
create_models
(
db
)
view1
=
CustomModelView
(
Model1
,
db
.
session
,
column_searchable_list
=
[
'test1'
,
])
admin
.
add_view
(
view1
)
db
.
session
.
add
(
Model2
(
'model1-test'
,
))
db
.
session
.
commit
()
client
=
app
.
test_client
()
# check that extra args in the url are propagated as hidden fields in the search form
rv
=
client
.
get
(
'/admin/model1/?search=model1&foo=bar'
)
data
=
rv
.
data
.
decode
(
'utf-8'
)
ok_
(
'<input type="hidden" name="foo" value="bar">'
in
data
)
def
test_extra_args_filter
():
app
,
db
,
admin
=
setup
()
Model1
,
Model2
=
create_models
(
db
)
view2
=
CustomModelView
(
Model2
,
db
.
session
,
column_filters
=
[
'int_field'
,
])
admin
.
add_view
(
view2
)
db
.
session
.
add
(
Model2
(
'model2-test'
,
5000
))
db
.
session
.
commit
()
client
=
app
.
test_client
()
# check that extra args in the url are propagated as hidden fields in the form
rv
=
client
.
get
(
'/admin/model2/?flt1_0=5000&foo=bar'
)
data
=
rv
.
data
.
decode
(
'utf-8'
)
ok_
(
'<input type="hidden" name="foo" value="bar">'
in
data
)
def
test_complex_searchable_list
():
app
,
db
,
admin
=
setup
()
...
...
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