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
6f78ec70
Commit
6f78ec70
authored
Oct 26, 2018
by
PJ Janse van Rensburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test new SQLA utils field filters.
parent
9a2fa7e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
9 deletions
+44
-9
test_basic.py
flask_admin/tests/sqla/test_basic.py
+44
-9
No files found.
flask_admin/tests/sqla/test_basic.py
View file @
6f78ec70
...
...
@@ -740,21 +740,21 @@ def test_column_filters():
)
eq_
(
[(
f
[
'index'
],
f
[
'operation'
])
for
f
in
view
.
_filter_groups
[
u'Model1 / E
num
Field'
]],
[(
f
[
'index'
],
f
[
'operation'
])
for
f
in
view
.
_filter_groups
[
u'Model1 / E
mail
Field'
]],
[
(
51
,
u'equals'
),
(
52
,
u'not equal'
),
(
53
,
u'empty'
),
(
54
,
u'in list'
),
(
55
,
u'not in list'
),
(
51
,
u'contains'
),
(
52
,
u'not contains'
),
(
53
,
u'equals'
),
(
54
,
u'not equal'
),
(
55
,
u'empty'
),
(
56
,
u'in list'
),
(
57
,
u'not in list'
),
]
)
eq_
(
[(
f
[
'index'
],
f
[
'operation'
])
for
f
in
view
.
_filter_groups
[
u'Model1 /
Choice
Field'
]],
[(
f
[
'index'
],
f
[
'operation'
])
for
f
in
view
.
_filter_groups
[
u'Model1 /
Enum
Field'
]],
[
(
56
,
u'contains'
),
(
57
,
u'not contains'
),
(
58
,
u'equals'
),
(
59
,
u'not equal'
),
(
60
,
u'empty'
),
...
...
@@ -763,6 +763,41 @@ def test_column_filters():
]
)
eq_
(
[(
f
[
'index'
],
f
[
'operation'
])
for
f
in
view
.
_filter_groups
[
u'Model1 / Choice Field'
]],
[
(
63
,
u'contains'
),
(
64
,
u'not contains'
),
(
65
,
u'equals'
),
(
66
,
u'not equal'
),
(
67
,
u'empty'
),
(
68
,
u'in list'
),
(
69
,
u'not in list'
),
]
)
eq_
(
[(
f
[
'index'
],
f
[
'operation'
])
for
f
in
view
.
_filter_groups
[
u'Model1 / Sqla Utils Choice Field'
]],
[
(
70
,
u'equals'
),
(
71
,
u'not equal'
),
(
72
,
u'contains'
),
(
73
,
u'not contains'
),
(
74
,
u'empty'
),
]
)
eq_
(
[(
f
[
'index'
],
f
[
'operation'
])
for
f
in
view
.
_filter_groups
[
u'Model1 / Sqla Utils Enum Field'
]],
[
(
75
,
u'equals'
),
(
76
,
u'not equal'
),
(
77
,
u'contains'
),
(
78
,
u'not contains'
),
(
79
,
u'empty'
),
]
)
# Test filter with a dot
view
=
CustomModelView
(
Model2
,
db
.
session
,
column_filters
=
[
'model1.bool_field'
])
...
...
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