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
756b9412
Commit
756b9412
authored
Dec 21, 2016
by
antoine.lizee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ref: move test-skipping logic to the __init__ file for the mongoengine tests
parent
2e107edc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
__init__.py
flask_admin/tests/mongoengine/__init__.py
+14
-0
test_basic.py
flask_admin/tests/mongoengine/test_basic.py
+3
-14
No files found.
flask_admin/tests/mongoengine/__init__.py
View file @
756b9412
import
sys
from
flask
import
Flask
from
nose.plugins.skip
import
SkipTest
from
flask_admin
import
Admin
from
flask_admin._compat
import
PY2
# Skip test on PY3
if
not
PY2
:
raise
SkipTest
(
'The MongoEngine integration is not Python 3 compatible'
)
# Skip test on Python 2.6 since it is still supported by flask-admin:
if
sys
.
version_info
[
0
]
==
2
and
sys
.
version_info
[
1
]
==
6
:
raise
SkipTest
(
'MongoEngine is not Python 2.6 compatible as of its 0.11 version.'
)
from
flask_mongoengine
import
MongoEngine
...
...
flask_admin/tests/mongoengine/test_basic.py
View file @
756b9412
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'
)
# Skip test on Python 2.6 since it is still supported by flask-admin:
import
sys
if
sys
.
version_info
[
0
]
==
2
and
sys
.
version_info
[
1
]
==
6
:
raise
SkipTest
(
'MongoEngine is not Python 2.6 compatible as of its 0.11 version.'
)
from
datetime
import
datetime
from
nose.tools
import
eq_
,
ok_
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