Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for ipv6 validator #403

Merged
merged 3 commits into from Jun 13, 2018
Merged

fix for ipv6 validator #403

merged 3 commits into from Jun 13, 2018

Conversation

jirivrany
Copy link
Contributor

@jirivrany jirivrany commented Jun 11, 2018

Here is a fix for ipv6 validator. It requires ipaddress package to be installed in Python 2. Python 3 is ok. I kept the old tests and added several more in pytest style.

closes #385

@jirivrany
Copy link
Contributor Author

@jirivrany jirivrany commented Jun 11, 2018

I'm not sure why the build for Python 2.7 is failing? Travis log shows, that ipaddress package has been installed sucessfully. Perhaps tox should be used for this external dependency configuration?

@davidism davidism changed the title fix for ipv6 validator - closes #385 fix for ipv6 validator Jun 12, 2018
adr = ip_address(ipv6=True)
field = DummyField(address)
with pytest.raises(ValidationError):
adr(None, field)
Copy link
Contributor

@ftm ftm Jun 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are all of these outside the test_ip_address function?

Copy link
Contributor Author

@jirivrany jirivrany Jun 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because of the test_ip_address is method written in UnitTest style. And @davidism told me, that I can use the PyTest style for the new tests. Because the original tests should be rewritten to PyTest style too in the future. And so I use the PyTest parametric tests.

Copy link
Member

@davidism davidism Jun 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine.

@ftm
Copy link
Contributor

@ftm ftm commented Jun 12, 2018

So is this all ready to merge then?

@davidism davidism merged commit 8acddc3 into wtforms:master Jun 13, 2018
1 check passed
azmeuk added a commit to azmeuk/wtforms that referenced this issue Apr 20, 2020
bodik added a commit to bodik/sner4 that referenced this issue Jun 2, 2020
…returns plain 500

ipv6 validator was fixed in wtforms 2.3.1 (wtforms/wtforms#403)
but in the same html escaping mechanism was changed to Markupsafe (wtforms/wtforms#400)
which requires all string literals to be explicitly marked as safe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants