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
7349a0af
Commit
7349a0af
authored
Jan 30, 2017
by
Paul Brown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix mongoengine tests
parent
bc98ff73
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
__init__.py
flask_admin/tests/mongoengine/__init__.py
+11
-0
test_basic.py
flask_admin/tests/mongoengine/test_basic.py
+2
-6
No files found.
flask_admin/tests/mongoengine/__init__.py
View file @
7349a0af
from
nose.plugins.skip
import
SkipTest
from
wtforms
import
__version__
as
wtforms_version
# Skip test on PY3
from
flask_admin._compat
import
PY2
if
not
PY2
:
raise
SkipTest
(
'MongoEngine is not Python 3 compatible'
)
if
int
(
wtforms_version
[
0
])
<
2
:
raise
SkipTest
(
'MongoEngine does not support WTForms 1.'
)
from
flask
import
Flask
from
flask_admin
import
Admin
from
flask_mongoengine
import
MongoEngine
...
...
flask_admin/tests/mongoengine/test_basic.py
View file @
7349a0af
from
nose.tools
import
eq_
,
ok_
from
nose.plugins.skip
import
SkipTest
# Skip test on PY3
from
flask_admin._compat
import
PY2
,
as_unicode
if
not
PY2
:
raise
SkipTest
(
'MongoEngine is not Python 3 compatible'
)
from
wtforms
import
fields
,
validators
from
flask_admin
import
form
from
flask_admin._compat
import
as_unicode
from
flask_admin.contrib.mongoengine
import
ModelView
from
.
import
setup
from
datetime
import
datetime
class
CustomModelView
(
ModelView
):
def
__init__
(
self
,
model
,
name
=
None
,
category
=
None
,
endpoint
=
None
,
url
=
None
,
...
...
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