-
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deprecate html5 in favor of using wtforms directly
- Loading branch information
Showing
5 changed files
with
15 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
# coding: utf-8 | ||
# flake8: noqa | ||
import warnings | ||
from flask_wtf._compat import FlaskWTFDeprecationWarning | ||
|
||
warnings.warn(FlaskWTFDeprecationWarning( | ||
'"flask_wtf.html5" will be removed in 1.0. ' | ||
'Import directly from "wtforms.fields.html5" ' | ||
'and "wtforms.widgets.html5".' | ||
), stacklevel=2) | ||
|
||
from wtforms.widgets.html5 import * | ||
from wtforms.fields.html5 import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import warnings | ||
from importlib import import_module | ||
from unittest import TestCase | ||
from flask_wtf import Form | ||
from flask_wtf._compat import FlaskWTFDeprecationWarning | ||
|
||
|
||
class TestForm(TestCase): | ||
def test_deprecated_form(self): | ||
def define_deprecated_form(): | ||
class F(Form): | ||
pass | ||
with warnings.catch_warnings(): | ||
warnings.simplefilter('error', FlaskWTFDeprecationWarning) | ||
self.assertRaises(FlaskWTFDeprecationWarning, type, 'F', (Form,), {}) | ||
|
||
def test_deprecated_html5(self): | ||
with warnings.catch_warnings(): | ||
warnings.simplefilter('error', FlaskWTFDeprecationWarning) | ||
self.assertRaises(FlaskWTFDeprecationWarning, define_deprecated_form) | ||
self.assertRaises(FlaskWTFDeprecationWarning, import_module, 'flask_wtf.html5') |
This file was deleted.
Oops, something went wrong.