instance_id stringclasses 28
values | test_id stringlengths 30 622 | affected bool 2
classes | text stringlengths 301 41.6M | license stringclasses 5
values |
|---|---|---|---|---|
wtforms__wtforms-614 | tests/test_validators.py::test_anyof_raisses[6-test_list1] | true | @pytest.mark.parametrize("test_v, test_list", [("d", ["a", "b", "c"]), (6, [1, 2, 3])])
def test_anyof_raisses(test_v, test_list, dummy_form, dummy_field):
"""
it should raise ValueError if the test_v is not present in the test_list
"""
validator = AnyOf(test_list)
dummy_field.data = test_v
with... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_anyof_raisses[d-test_list0] | true | @pytest.mark.parametrize("test_v, test_list", [("d", ["a", "b", "c"]), (6, [1, 2, 3])])
def test_anyof_raisses(test_v, test_list, dummy_form, dummy_field):
"""
it should raise ValueError if the test_v is not present in the test_list
"""
validator = AnyOf(test_list)
dummy_field.data = test_v
with... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_ip4address_raises[127.0.0.abc] | true | @pytest.mark.parametrize(
"address",
[
"147.230.1000.25",
"2001:718::::",
"abc.0.0.1",
"1278.0.0.1",
"127.0.0.abc",
"900.200.100.75",
],
)
def test_bad_ip4address_raises(address, dummy_form, dummy_field):
adr = ip_address(ipv6=True)
dummy_field.data = ... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_ip4address_raises[1278.0.0.1] | true | @pytest.mark.parametrize(
"address",
[
"147.230.1000.25",
"2001:718::::",
"abc.0.0.1",
"1278.0.0.1",
"127.0.0.abc",
"900.200.100.75",
],
)
def test_bad_ip4address_raises(address, dummy_form, dummy_field):
adr = ip_address(ipv6=True)
dummy_field.data = ... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_ip4address_raises[147.230.1000.25] | true | @pytest.mark.parametrize(
"address",
[
"147.230.1000.25",
"2001:718::::",
"abc.0.0.1",
"1278.0.0.1",
"127.0.0.abc",
"900.200.100.75",
],
)
def test_bad_ip4address_raises(address, dummy_form, dummy_field):
adr = ip_address(ipv6=True)
dummy_field.data = ... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_ip4address_raises[2001:718::::] | true | @pytest.mark.parametrize(
"address",
[
"147.230.1000.25",
"2001:718::::",
"abc.0.0.1",
"1278.0.0.1",
"127.0.0.abc",
"900.200.100.75",
],
)
def test_bad_ip4address_raises(address, dummy_form, dummy_field):
adr = ip_address(ipv6=True)
dummy_field.data = ... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_ip4address_raises[900.200.100.75] | true | @pytest.mark.parametrize(
"address",
[
"147.230.1000.25",
"2001:718::::",
"abc.0.0.1",
"1278.0.0.1",
"127.0.0.abc",
"900.200.100.75",
],
)
def test_bad_ip4address_raises(address, dummy_form, dummy_field):
adr = ip_address(ipv6=True)
dummy_field.data = ... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_ip4address_raises[abc.0.0.1] | true | @pytest.mark.parametrize(
"address",
[
"147.230.1000.25",
"2001:718::::",
"abc.0.0.1",
"1278.0.0.1",
"127.0.0.abc",
"900.200.100.75",
],
)
def test_bad_ip4address_raises(address, dummy_form, dummy_field):
adr = ip_address(ipv6=True)
dummy_field.data = ... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_ip6address_raises[1:2:3:4:5:6:7:8:9] | true | @pytest.mark.parametrize(
"address",
[
"2001:718:1C01:1111::1111",
"2001:718:1C01:1111::",
"abc.0.0.1",
"abcd:1234::123::1",
"1:2:3:4:5:6:7:8:9",
"abcd::1ffff",
],
)
def test_bad_ip6address_raises(address, dummy_form, dummy_field):
adr = ip_address()
d... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_ip6address_raises[2001:718:1C01:1111::1111] | true | @pytest.mark.parametrize(
"address",
[
"2001:718:1C01:1111::1111",
"2001:718:1C01:1111::",
"abc.0.0.1",
"abcd:1234::123::1",
"1:2:3:4:5:6:7:8:9",
"abcd::1ffff",
],
)
def test_bad_ip6address_raises(address, dummy_form, dummy_field):
adr = ip_address()
d... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_ip6address_raises[2001:718:1C01:1111::] | true | @pytest.mark.parametrize(
"address",
[
"2001:718:1C01:1111::1111",
"2001:718:1C01:1111::",
"abc.0.0.1",
"abcd:1234::123::1",
"1:2:3:4:5:6:7:8:9",
"abcd::1ffff",
],
)
def test_bad_ip6address_raises(address, dummy_form, dummy_field):
adr = ip_address()
d... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_ip6address_raises[abc.0.0.1] | true | @pytest.mark.parametrize(
"address",
[
"2001:718:1C01:1111::1111",
"2001:718:1C01:1111::",
"abc.0.0.1",
"abcd:1234::123::1",
"1:2:3:4:5:6:7:8:9",
"abcd::1ffff",
],
)
def test_bad_ip6address_raises(address, dummy_form, dummy_field):
adr = ip_address()
d... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_ip6address_raises[abcd:1234::123::1] | true | @pytest.mark.parametrize(
"address",
[
"2001:718:1C01:1111::1111",
"2001:718:1C01:1111::",
"abc.0.0.1",
"abcd:1234::123::1",
"1:2:3:4:5:6:7:8:9",
"abcd::1ffff",
],
)
def test_bad_ip6address_raises(address, dummy_form, dummy_field):
adr = ip_address()
d... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_ip6address_raises[abcd::1ffff] | true | @pytest.mark.parametrize(
"address",
[
"2001:718:1C01:1111::1111",
"2001:718:1C01:1111::",
"abc.0.0.1",
"abcd:1234::123::1",
"1:2:3:4:5:6:7:8:9",
"abcd::1ffff",
],
)
def test_bad_ip6address_raises(address, dummy_form, dummy_field):
adr = ip_address()
d... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_length_init_raises[-1--1] | true | @pytest.mark.parametrize(
"min_v, max_v",
[(-1, -1), (5, 2)], # none of the values is specified # max should be gt min
)
def test_bad_length_init_raises(min_v, max_v):
"""
It should raise AssertionError if the validator constructor got wrong values
"""
with pytest.raises(AssertionError):
... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_length_init_raises[5-2] | true | @pytest.mark.parametrize(
"min_v, max_v",
[(-1, -1), (5, 2)], # none of the values is specified # max should be gt min
)
def test_bad_length_init_raises(min_v, max_v):
"""
It should raise AssertionError if the validator constructor got wrong values
"""
with pytest.raises(AssertionError):
... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_length_raises[-1-5] | true | @pytest.mark.parametrize("min_v, max_v", [(7, -1), (-1, 5)])
def test_bad_length_raises(min_v, max_v, dummy_form, dummy_field):
"""
It should raise ValidationError for string with incorect length
"""
dummy_field.data = "foobar"
validator = length(min_v, max_v)
with pytest.raises(ValidationError)... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_length_raises[7--1] | true | @pytest.mark.parametrize("min_v, max_v", [(7, -1), (-1, 5)])
def test_bad_length_raises(min_v, max_v, dummy_form, dummy_field):
"""
It should raise ValidationError for string with incorect length
"""
dummy_field.data = "foobar"
validator = length(min_v, max_v)
with pytest.raises(ValidationError)... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_mac_raises[00:00:00:00:00] | true | @pytest.mark.parametrize(
"mac_addr_val",
["00:00:00:00:00", "01:23:45:67:89:", "01:23:45:67:89:gh", "123:23:45:67:89:00"],
)
def test_bad_mac_raises(mac_addr_val, dummy_form, dummy_field):
"""
Bad MAC address should raise ValidatioError
"""
validator = mac_address()
dummy_field.data = mac_a... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_mac_raises[01:23:45:67:89:] | true | @pytest.mark.parametrize(
"mac_addr_val",
["00:00:00:00:00", "01:23:45:67:89:", "01:23:45:67:89:gh", "123:23:45:67:89:00"],
)
def test_bad_mac_raises(mac_addr_val, dummy_form, dummy_field):
"""
Bad MAC address should raise ValidatioError
"""
validator = mac_address()
dummy_field.data = mac_a... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_mac_raises[01:23:45:67:89:gh] | true | @pytest.mark.parametrize(
"mac_addr_val",
["00:00:00:00:00", "01:23:45:67:89:", "01:23:45:67:89:gh", "123:23:45:67:89:00"],
)
def test_bad_mac_raises(mac_addr_val, dummy_form, dummy_field):
"""
Bad MAC address should raise ValidatioError
"""
validator = mac_address()
dummy_field.data = mac_a... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_mac_raises[123:23:45:67:89:00] | true | @pytest.mark.parametrize(
"mac_addr_val",
["00:00:00:00:00", "01:23:45:67:89:", "01:23:45:67:89:gh", "123:23:45:67:89:00"],
)
def test_bad_mac_raises(mac_addr_val, dummy_form, dummy_field):
"""
Bad MAC address should raise ValidatioError
"""
validator = mac_address()
dummy_field.data = mac_a... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_url_raises[foobar.dk] | true | @pytest.mark.parametrize(
"url_val",
[
"http://foobar",
"http://-foobar.dk/",
"http://foobar-.dk/",
"foobar.dk",
"http://127.0.0/asdf",
"http://foobar.d",
"http://foobar.12",
"http://localhost:abc/a",
],
)
def test_bad_url_raises(url_val, dummy... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_url_raises[http://-foobar.dk/] | true | @pytest.mark.parametrize(
"url_val",
[
"http://foobar",
"http://-foobar.dk/",
"http://foobar-.dk/",
"foobar.dk",
"http://127.0.0/asdf",
"http://foobar.d",
"http://foobar.12",
"http://localhost:abc/a",
],
)
def test_bad_url_raises(url_val, dummy... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_url_raises[http://127.0.0/asdf] | true | @pytest.mark.parametrize(
"url_val",
[
"http://foobar",
"http://-foobar.dk/",
"http://foobar-.dk/",
"foobar.dk",
"http://127.0.0/asdf",
"http://foobar.d",
"http://foobar.12",
"http://localhost:abc/a",
],
)
def test_bad_url_raises(url_val, dummy... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_url_raises[http://foobar-.dk/] | true | @pytest.mark.parametrize(
"url_val",
[
"http://foobar",
"http://-foobar.dk/",
"http://foobar-.dk/",
"foobar.dk",
"http://127.0.0/asdf",
"http://foobar.d",
"http://foobar.12",
"http://localhost:abc/a",
],
)
def test_bad_url_raises(url_val, dummy... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_url_raises[http://foobar.12] | true | @pytest.mark.parametrize(
"url_val",
[
"http://foobar",
"http://-foobar.dk/",
"http://foobar-.dk/",
"foobar.dk",
"http://127.0.0/asdf",
"http://foobar.d",
"http://foobar.12",
"http://localhost:abc/a",
],
)
def test_bad_url_raises(url_val, dummy... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_url_raises[http://foobar.d] | true | @pytest.mark.parametrize(
"url_val",
[
"http://foobar",
"http://-foobar.dk/",
"http://foobar-.dk/",
"foobar.dk",
"http://127.0.0/asdf",
"http://foobar.d",
"http://foobar.12",
"http://localhost:abc/a",
],
)
def test_bad_url_raises(url_val, dummy... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_url_raises[http://foobar] | true | @pytest.mark.parametrize(
"url_val",
[
"http://foobar",
"http://-foobar.dk/",
"http://foobar-.dk/",
"foobar.dk",
"http://127.0.0/asdf",
"http://foobar.d",
"http://foobar.12",
"http://localhost:abc/a",
],
)
def test_bad_url_raises(url_val, dummy... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_url_raises[http://localhost:abc/a] | true | @pytest.mark.parametrize(
"url_val",
[
"http://foobar",
"http://-foobar.dk/",
"http://foobar-.dk/",
"foobar.dk",
"http://127.0.0/asdf",
"http://foobar.d",
"http://foobar.12",
"http://localhost:abc/a",
],
)
def test_bad_url_raises(url_val, dummy... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_uuid_raises[2bc1c94f 0deb-43e9-92a1-4775189ec9f8] | true | @pytest.mark.parametrize(
"uuid_val",
[
"2bc1c94f-deb-43e9-92a1-4775189ec9f8",
"2bc1c94f-0deb-43e9-92a1-4775189ec9f",
"gbc1c94f-0deb-43e9-92a1-4775189ec9f8",
"2bc1c94f 0deb-43e9-92a1-4775189ec9f8",
],
)
def test_bad_uuid_raises(uuid_val, dummy_form, dummy_field):
"""
... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_uuid_raises[2bc1c94f-0deb-43e9-92a1-4775189ec9f] | true | @pytest.mark.parametrize(
"uuid_val",
[
"2bc1c94f-deb-43e9-92a1-4775189ec9f8",
"2bc1c94f-0deb-43e9-92a1-4775189ec9f",
"gbc1c94f-0deb-43e9-92a1-4775189ec9f8",
"2bc1c94f 0deb-43e9-92a1-4775189ec9f8",
],
)
def test_bad_uuid_raises(uuid_val, dummy_form, dummy_field):
"""
... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_uuid_raises[2bc1c94f-deb-43e9-92a1-4775189ec9f8] | true | @pytest.mark.parametrize(
"uuid_val",
[
"2bc1c94f-deb-43e9-92a1-4775189ec9f8",
"2bc1c94f-0deb-43e9-92a1-4775189ec9f",
"gbc1c94f-0deb-43e9-92a1-4775189ec9f8",
"2bc1c94f 0deb-43e9-92a1-4775189ec9f8",
],
)
def test_bad_uuid_raises(uuid_val, dummy_form, dummy_field):
"""
... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_bad_uuid_raises[gbc1c94f-0deb-43e9-92a1-4775189ec9f8] | true | @pytest.mark.parametrize(
"uuid_val",
[
"2bc1c94f-deb-43e9-92a1-4775189ec9f8",
"2bc1c94f-0deb-43e9-92a1-4775189ec9f",
"gbc1c94f-0deb-43e9-92a1-4775189ec9f8",
"2bc1c94f 0deb-43e9-92a1-4775189ec9f8",
],
)
def test_bad_uuid_raises(uuid_val, dummy_form, dummy_field):
"""
... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_correct_length_passes[-1-6] | true | @pytest.mark.parametrize("min_v, max_v", [(2, 6), (6, -1), (-1, 6), (6, 6)])
def test_correct_length_passes(min_v, max_v, dummy_form, dummy_field):
"""
It should pass for the string with correct length
"""
dummy_field.data = "foobar"
validator = length(min_v, max_v)
validator(dummy_form, dummy_f... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_correct_length_passes[2-6] | true | @pytest.mark.parametrize("min_v, max_v", [(2, 6), (6, -1), (-1, 6), (6, 6)])
def test_correct_length_passes(min_v, max_v, dummy_form, dummy_field):
"""
It should pass for the string with correct length
"""
dummy_field.data = "foobar"
validator = length(min_v, max_v)
validator(dummy_form, dummy_f... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_correct_length_passes[6--1] | true | @pytest.mark.parametrize("min_v, max_v", [(2, 6), (6, -1), (-1, 6), (6, 6)])
def test_correct_length_passes(min_v, max_v, dummy_form, dummy_field):
"""
It should pass for the string with correct length
"""
dummy_field.data = "foobar"
validator = length(min_v, max_v)
validator(dummy_form, dummy_f... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_correct_length_passes[6-6] | true | @pytest.mark.parametrize("min_v, max_v", [(2, 6), (6, -1), (-1, 6), (6, 6)])
def test_correct_length_passes(min_v, max_v, dummy_form, dummy_field):
"""
It should pass for the string with correct length
"""
dummy_field.data = "foobar"
validator = length(min_v, max_v)
validator(dummy_form, dummy_f... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_data_required | true | def test_data_required(dummy_form, dummy_field):
"""
Should pass if the required data are present
"""
validator = data_required()
dummy_field.data = "foobar"
validator(dummy_form, dummy_field)
assert validator.field_flags == {"required": True}
# --- pre-patch trace ---
# === tests/test_vali... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_data_required_clobber | true | def test_data_required_clobber(dummy_form, dummy_field):
"""
Data required should clobber the errors
"""
validator = data_required()
dummy_field.data = ""
dummy_field.errors = ["Invalid Integer Value"]
assert len(dummy_field.errors) == 1
with pytest.raises(StopValidation):
valida... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_data_required_messages[validator0-This field is required.] | true | @pytest.mark.parametrize(
("validator", "message"),
(
(data_required(), "This field is required."),
(data_required(message="foo"), "foo"),
),
)
def test_data_required_messages(dummy_form, dummy_field, validator, message):
"""
Check data_required message and custom message
"""
... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_data_required_messages[validator1-foo] | true | @pytest.mark.parametrize(
("validator", "message"),
(
(data_required(), "This field is required."),
(data_required(message="foo"), "foo"),
),
)
def test_data_required_messages(dummy_form, dummy_field, validator, message):
"""
Check data_required message and custom message
"""
... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_data_required_raises[ ] | true | @pytest.mark.parametrize("bad_val", [None, "", " ", "\t\t"])
def test_data_required_raises(bad_val, dummy_form, dummy_field):
"""
data_required should stop the validation chain if data are not present
"""
validator = data_required()
dummy_field.data = bad_val
with pytest.raises(StopValidation):
... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_data_required_raises[None] | true | @pytest.mark.parametrize("bad_val", [None, "", " ", "\t\t"])
def test_data_required_raises(bad_val, dummy_form, dummy_field):
"""
data_required should stop the validation chain if data are not present
"""
validator = data_required()
dummy_field.data = bad_val
with pytest.raises(StopValidation):
... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_data_required_raises[\t\t] | true | @pytest.mark.parametrize("bad_val", [None, "", " ", "\t\t"])
def test_data_required_raises(bad_val, dummy_form, dummy_field):
"""
data_required should stop the validation chain if data are not present
"""
validator = data_required()
dummy_field.data = bad_val
with pytest.raises(StopValidation):
... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_data_required_raises[] | true | @pytest.mark.parametrize("bad_val", [None, "", " ", "\t\t"])
def test_data_required_raises(bad_val, dummy_form, dummy_field):
"""
data_required should stop the validation chain if data are not present
"""
validator = data_required()
dummy_field.data = bad_val
with pytest.raises(StopValidation):
... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_equal_to_passes | true | def test_equal_to_passes(dummy_form, dummy_field):
"""
Equal values should pass
"""
dummy_field.data = "test"
dummy_form["foo"] = dummy_field
validator = equal_to("foo")
validator(dummy_form, dummy_form["foo"])
# --- pre-patch trace ---
# === tests/test_validators.py::test_equal_to_passes (... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_equal_to_raises[bad_value-foo] | true | @pytest.mark.parametrize(
"field_val,equal_val", [("test", "invalid_field_name"), ("bad_value", "foo")]
)
def test_equal_to_raises(
field_val, equal_val, dummy_form, dummy_field, dummy_field_class
):
"""
It should raise ValidationError if the values are not equal
"""
dummy_form["foo"] = dummy_fi... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_equal_to_raises[test-invalid_field_name] | true | @pytest.mark.parametrize(
"field_val,equal_val", [("test", "invalid_field_name"), ("bad_value", "foo")]
)
def test_equal_to_raises(
field_val, equal_val, dummy_form, dummy_field, dummy_field_class
):
"""
It should raise ValidationError if the values are not equal
"""
dummy_form["foo"] = dummy_fi... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_good_ip6address_passes[2001:718:1C01:1111::1111] | true | @pytest.mark.parametrize(
"address",
[
"2001:718:1C01:1111::1111",
"2001:718:1C01:1111::",
"::1",
"dead:beef:0:0:0:0:42:1",
"abcd:ef::42:1",
],
)
def test_good_ip6address_passes(address, dummy_form, dummy_field):
adr = ip_address(ipv6=True)
dummy_field.data = ... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_good_ip6address_passes[2001:718:1C01:1111::] | true | @pytest.mark.parametrize(
"address",
[
"2001:718:1C01:1111::1111",
"2001:718:1C01:1111::",
"::1",
"dead:beef:0:0:0:0:42:1",
"abcd:ef::42:1",
],
)
def test_good_ip6address_passes(address, dummy_form, dummy_field):
adr = ip_address(ipv6=True)
dummy_field.data = ... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_good_ip6address_passes[::1] | true | @pytest.mark.parametrize(
"address",
[
"2001:718:1C01:1111::1111",
"2001:718:1C01:1111::",
"::1",
"dead:beef:0:0:0:0:42:1",
"abcd:ef::42:1",
],
)
def test_good_ip6address_passes(address, dummy_form, dummy_field):
adr = ip_address(ipv6=True)
dummy_field.data = ... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_good_ip6address_passes[abcd:ef::42:1] | true | @pytest.mark.parametrize(
"address",
[
"2001:718:1C01:1111::1111",
"2001:718:1C01:1111::",
"::1",
"dead:beef:0:0:0:0:42:1",
"abcd:ef::42:1",
],
)
def test_good_ip6address_passes(address, dummy_form, dummy_field):
adr = ip_address(ipv6=True)
dummy_field.data = ... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_good_ip6address_passes[dead:beef:0:0:0:0:42:1] | true | @pytest.mark.parametrize(
"address",
[
"2001:718:1C01:1111::1111",
"2001:718:1C01:1111::",
"::1",
"dead:beef:0:0:0:0:42:1",
"abcd:ef::42:1",
],
)
def test_good_ip6address_passes(address, dummy_form, dummy_field):
adr = ip_address(ipv6=True)
dummy_field.data = ... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_input_optional_passes | true | def test_input_optional_passes(dummy_form, dummy_field):
"""
optional should pause with given values
"""
validator = optional()
dummy_field.data = "foobar"
dummy_field.raw_data = ["foobar"]
validator(dummy_form, dummy_field)
# --- pre-patch trace ---
# === tests/test_validators.py::test_inp... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_input_optional_raises[ - ] | true | @pytest.mark.parametrize("data_v, raw_data_v", [("", ""), (" ", " "), ("\t", "\t")])
def test_input_optional_raises(data_v, raw_data_v, dummy_form, dummy_field):
"""
optional should stop the validation chain if the data are not given
errors should be erased because the value is optional
white space ... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_input_optional_raises[-] | true | @pytest.mark.parametrize("data_v, raw_data_v", [("", ""), (" ", " "), ("\t", "\t")])
def test_input_optional_raises(data_v, raw_data_v, dummy_form, dummy_field):
"""
optional should stop the validation chain if the data are not given
errors should be erased because the value is optional
white space ... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_input_optional_raises[\t-\t] | true | @pytest.mark.parametrize("data_v, raw_data_v", [("", ""), (" ", " "), ("\t", "\t")])
def test_input_optional_raises(data_v, raw_data_v, dummy_form, dummy_field):
"""
optional should stop the validation chain if the data are not given
errors should be erased because the value is optional
white space ... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_input_required | true | def test_input_required(dummy_form, dummy_field):
"""
it should pass if the required value is present
"""
validator = input_required()
dummy_field.data = "foobar"
dummy_field.raw_data = ["foobar"]
validator(dummy_form, dummy_field)
assert validator.field_flags == {"required": True}
# -... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_input_required_error_message[validator0-This field is required.] | true | @pytest.mark.parametrize(
("validator", "message"),
(
(input_required(), "This field is required."),
(input_required(message="foo"), "foo"),
),
)
def test_input_required_error_message(dummy_form, dummy_field, validator, message):
"""
It should return error message when the required v... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_input_required_error_message[validator1-foo] | true | @pytest.mark.parametrize(
("validator", "message"),
(
(input_required(), "This field is required."),
(input_required(message="foo"), "foo"),
),
)
def test_input_required_error_message(dummy_form, dummy_field, validator, message):
"""
It should return error message when the required v... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_input_required_raises | true | def test_input_required_raises(dummy_form, dummy_field):
"""
It should stop the validation chain if the required value is not present
"""
validator = input_required()
dummy_field.data = ""
dummy_field.raw_data = [""]
with pytest.raises(StopValidation):
validator(dummy_form, dummy_fie... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_invalid_email_raises[ ] | true | @pytest.mark.parametrize(
"email_address",
[
None,
"",
" ",
"foo",
"bar.dk",
"foo@",
"@bar.dk",
"foo@bar",
"foo@bar.ab12",
"foo@.bar.ab",
"foo.@bar.co",
"foo@foo@bar.co",
"fo o@bar.co",
],
)
def test_inv... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_invalid_email_raises[@bar.dk] | true | @pytest.mark.parametrize(
"email_address",
[
None,
"",
" ",
"foo",
"bar.dk",
"foo@",
"@bar.dk",
"foo@bar",
"foo@bar.ab12",
"foo@.bar.ab",
"foo.@bar.co",
"foo@foo@bar.co",
"fo o@bar.co",
],
)
def test_inv... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_invalid_email_raises[None] | true | @pytest.mark.parametrize(
"email_address",
[
None,
"",
" ",
"foo",
"bar.dk",
"foo@",
"@bar.dk",
"foo@bar",
"foo@bar.ab12",
"foo@.bar.ab",
"foo.@bar.co",
"foo@foo@bar.co",
"fo o@bar.co",
],
)
def test_inv... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_invalid_email_raises[] | true | @pytest.mark.parametrize(
"email_address",
[
None,
"",
" ",
"foo",
"bar.dk",
"foo@",
"@bar.dk",
"foo@bar",
"foo@bar.ab12",
"foo@.bar.ab",
"foo.@bar.co",
"foo@foo@bar.co",
"fo o@bar.co",
],
)
def test_inv... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_invalid_email_raises[bar.dk] | true | @pytest.mark.parametrize(
"email_address",
[
None,
"",
" ",
"foo",
"bar.dk",
"foo@",
"@bar.dk",
"foo@bar",
"foo@bar.ab12",
"foo@.bar.ab",
"foo.@bar.co",
"foo@foo@bar.co",
"fo o@bar.co",
],
)
def test_inv... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_invalid_email_raises[fo o@bar.co] | true | @pytest.mark.parametrize(
"email_address",
[
None,
"",
" ",
"foo",
"bar.dk",
"foo@",
"@bar.dk",
"foo@bar",
"foo@bar.ab12",
"foo@.bar.ab",
"foo.@bar.co",
"foo@foo@bar.co",
"fo o@bar.co",
],
)
def test_inv... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_invalid_email_raises[foo.@bar.co] | true | @pytest.mark.parametrize(
"email_address",
[
None,
"",
" ",
"foo",
"bar.dk",
"foo@",
"@bar.dk",
"foo@bar",
"foo@bar.ab12",
"foo@.bar.ab",
"foo.@bar.co",
"foo@foo@bar.co",
"fo o@bar.co",
],
)
def test_inv... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_invalid_email_raises[foo@.bar.ab] | true | @pytest.mark.parametrize(
"email_address",
[
None,
"",
" ",
"foo",
"bar.dk",
"foo@",
"@bar.dk",
"foo@bar",
"foo@bar.ab12",
"foo@.bar.ab",
"foo.@bar.co",
"foo@foo@bar.co",
"fo o@bar.co",
],
)
def test_inv... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_invalid_email_raises[foo@] | true | @pytest.mark.parametrize(
"email_address",
[
None,
"",
" ",
"foo",
"bar.dk",
"foo@",
"@bar.dk",
"foo@bar",
"foo@bar.ab12",
"foo@.bar.ab",
"foo.@bar.co",
"foo@foo@bar.co",
"fo o@bar.co",
],
)
def test_inv... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_invalid_email_raises[foo@bar.ab12] | true | @pytest.mark.parametrize(
"email_address",
[
None,
"",
" ",
"foo",
"bar.dk",
"foo@",
"@bar.dk",
"foo@bar",
"foo@bar.ab12",
"foo@.bar.ab",
"foo.@bar.co",
"foo@foo@bar.co",
"fo o@bar.co",
],
)
def test_inv... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_invalid_email_raises[foo@bar] | true | @pytest.mark.parametrize(
"email_address",
[
None,
"",
" ",
"foo",
"bar.dk",
"foo@",
"@bar.dk",
"foo@bar",
"foo@bar.ab12",
"foo@.bar.ab",
"foo.@bar.co",
"foo@foo@bar.co",
"fo o@bar.co",
],
)
def test_inv... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_invalid_email_raises[foo@foo@bar.co] | true | @pytest.mark.parametrize(
"email_address",
[
None,
"",
" ",
"foo",
"bar.dk",
"foo@",
"@bar.dk",
"foo@bar",
"foo@bar.ab12",
"foo@.bar.ab",
"foo.@bar.co",
"foo@foo@bar.co",
"fo o@bar.co",
],
)
def test_inv... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_invalid_email_raises[foo] | true | @pytest.mark.parametrize(
"email_address",
[
None,
"",
" ",
"foo",
"bar.dk",
"foo@",
"@bar.dk",
"foo@bar",
"foo@bar.ab12",
"foo@.bar.ab",
"foo.@bar.co",
"foo@foo@bar.co",
"fo o@bar.co",
],
)
def test_inv... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_invalid_email_raises_granular_message[foo@] | true | @pytest.mark.parametrize("email_address", ["foo@"])
def test_invalid_email_raises_granular_message(email_address, dummy_form, dummy_field):
"""
When granular_message=True uses message from email_validator library.
"""
validator = email(granular_message=True)
dummy_field.data = email_address
with... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_ip4address_passes[127.0.0.1] | true | @pytest.mark.parametrize("address", ["147.230.23.25", "147.230.23.0", "127.0.0.1"])
def test_ip4address_passes(address, dummy_form, dummy_field):
adr = ip_address()
dummy_field.data = address
adr(dummy_form, dummy_field)
# --- pre-patch trace ---
# === tests/test_validators.py::test_ip4address_passes (line... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_ip4address_passes[147.230.23.0] | true | @pytest.mark.parametrize("address", ["147.230.23.25", "147.230.23.0", "127.0.0.1"])
def test_ip4address_passes(address, dummy_form, dummy_field):
adr = ip_address()
dummy_field.data = address
adr(dummy_form, dummy_field)
# --- pre-patch trace ---
# === tests/test_validators.py::test_ip4address_passes (line... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_ip4address_passes[147.230.23.25] | true | @pytest.mark.parametrize("address", ["147.230.23.25", "147.230.23.0", "127.0.0.1"])
def test_ip4address_passes(address, dummy_form, dummy_field):
adr = ip_address()
dummy_field.data = address
adr(dummy_form, dummy_field)
# --- pre-patch trace ---
# === tests/test_validators.py::test_ip4address_passes (line... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_ip_address_raises_on_bad_init | true | def test_ip_address_raises_on_bad_init():
"""
IpAddress validator should raise ValueError when ipv6=False and ipv4=False
"""
with pytest.raises(ValueError):
ip_address(ipv4=False, ipv6=False)
# --- pre-patch trace ---
# === tests/test_validators.py::test_ip_address_raises_on_bad_init (line 269)... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_lazy_proxy_fixture | true | def test_lazy_proxy_fixture(really_lazy_proxy):
"""
Tests that the validators support lazy translation strings for messages.
"""
equal_to("fieldname", message=really_lazy_proxy)
length(min=1, message=really_lazy_proxy)
NumberRange(1, 5, message=really_lazy_proxy)
data_required(message=really... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_lazy_proxy_raises | true | def test_lazy_proxy_raises(really_lazy_proxy):
"""
Tests that the validators support lazy translation strings for messages.
"""
with pytest.raises(Exception):
str(really_lazy_proxy)
# --- pre-patch trace ---
# === tests/test_validators.py::test_lazy_proxy_raises (line 600) ===
def test_lazy_pro... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_length_messages[validator0-2 and 5] | true | @pytest.mark.parametrize(
("validator", "message"),
(
(length(2, 5, "%(min)d and %(max)d"), "2 and 5"),
(length(8, -1), "at least 8"),
(length(-1, 5), "longer than 5"),
(length(2, 5), "between 2 and 5"),
(length(5, 5), "exactly 5"),
),
)
def test_length_messages(dummy... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_length_messages[validator1-at least 8] | true | @pytest.mark.parametrize(
("validator", "message"),
(
(length(2, 5, "%(min)d and %(max)d"), "2 and 5"),
(length(8, -1), "at least 8"),
(length(-1, 5), "longer than 5"),
(length(2, 5), "between 2 and 5"),
(length(5, 5), "exactly 5"),
),
)
def test_length_messages(dummy... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_length_messages[validator2-longer than 5] | true | @pytest.mark.parametrize(
("validator", "message"),
(
(length(2, 5, "%(min)d and %(max)d"), "2 and 5"),
(length(8, -1), "at least 8"),
(length(-1, 5), "longer than 5"),
(length(2, 5), "between 2 and 5"),
(length(5, 5), "exactly 5"),
),
)
def test_length_messages(dummy... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_length_messages[validator3-between 2 and 5] | true | @pytest.mark.parametrize(
("validator", "message"),
(
(length(2, 5, "%(min)d and %(max)d"), "2 and 5"),
(length(8, -1), "at least 8"),
(length(-1, 5), "longer than 5"),
(length(2, 5), "between 2 and 5"),
(length(5, 5), "exactly 5"),
),
)
def test_length_messages(dummy... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_length_messages[validator4-exactly 5] | true | @pytest.mark.parametrize(
("validator", "message"),
(
(length(2, 5, "%(min)d and %(max)d"), "2 and 5"),
(length(8, -1), "at least 8"),
(length(-1, 5), "longer than 5"),
(length(2, 5), "between 2 and 5"),
(length(5, 5), "exactly 5"),
),
)
def test_length_messages(dummy... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_none_of_passes | true | def test_none_of_passes(dummy_form, dummy_field):
"""
it should pass if the value is not present in list
"""
dummy_field.data = "d"
validator = NoneOf(["a", "b", "c"])
validator(dummy_form, dummy_field)
# --- pre-patch trace ---
# === tests/test_validators.py::test_none_of_passes (line 486) ===... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_none_of_raises | true | def test_none_of_raises(dummy_form, dummy_field):
"""
it should raise ValueError if the value is present in list
"""
dummy_field.data = "a"
validator = NoneOf(["a", "b", "c"])
with pytest.raises(ValueError):
validator(dummy_form, dummy_field)
# --- pre-patch trace ---
# === tests/test_v... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_number_range_nan[nan1] | true | @pytest.mark.parametrize("nan", [float("NaN"), decimal.Decimal("NaN")])
def test_number_range_nan(nan, dummy_form, dummy_field):
validator = NumberRange(0, 10)
dummy_field.data = nan
with pytest.raises(ValidationError):
validator(dummy_form, dummy_field)
# --- pre-patch trace ---
# === tests/test_v... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_number_range_nan[nan] | true | @pytest.mark.parametrize("nan", [float("NaN"), decimal.Decimal("NaN")])
def test_number_range_nan(nan, dummy_form, dummy_field):
validator = NumberRange(0, 10)
dummy_field.data = nan
with pytest.raises(ValidationError):
validator(dummy_form, dummy_field)
# --- pre-patch trace ---
# === tests/test_v... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_number_range_passes[5-10-7] | true | @pytest.mark.parametrize(
"min_v, max_v, test_v", [(5, 10, 7), (5, None, 7), (None, 100, 70)]
)
def test_number_range_passes(min_v, max_v, test_v, dummy_form, dummy_field):
"""
It should pass if the test_v is between min_v and max_v
"""
dummy_field.data = test_v
validator = NumberRange(min_v, ma... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_number_range_passes[5-None-7] | true | @pytest.mark.parametrize(
"min_v, max_v, test_v", [(5, 10, 7), (5, None, 7), (None, 100, 70)]
)
def test_number_range_passes(min_v, max_v, test_v, dummy_form, dummy_field):
"""
It should pass if the test_v is between min_v and max_v
"""
dummy_field.data = test_v
validator = NumberRange(min_v, ma... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_number_range_passes[None-100-70] | true | @pytest.mark.parametrize(
"min_v, max_v, test_v", [(5, 10, 7), (5, None, 7), (None, 100, 70)]
)
def test_number_range_passes(min_v, max_v, test_v, dummy_form, dummy_field):
"""
It should pass if the test_v is between min_v and max_v
"""
dummy_field.data = test_v
validator = NumberRange(min_v, ma... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_number_range_raises[5-10--5] | true | @pytest.mark.parametrize(
"min_v, max_v, test_v",
[
(5, 10, None),
(5, 10, 0),
(5, 10, 12),
(5, 10, -5),
(5, None, 4),
(None, 100, 500),
],
)
def test_number_range_raises(min_v, max_v, test_v, dummy_form, dummy_field):
"""
It should raise ValidationErr... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_number_range_raises[5-10-0] | true | @pytest.mark.parametrize(
"min_v, max_v, test_v",
[
(5, 10, None),
(5, 10, 0),
(5, 10, 12),
(5, 10, -5),
(5, None, 4),
(None, 100, 500),
],
)
def test_number_range_raises(min_v, max_v, test_v, dummy_form, dummy_field):
"""
It should raise ValidationErr... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_number_range_raises[5-10-12] | true | @pytest.mark.parametrize(
"min_v, max_v, test_v",
[
(5, 10, None),
(5, 10, 0),
(5, 10, 12),
(5, 10, -5),
(5, None, 4),
(None, 100, 500),
],
)
def test_number_range_raises(min_v, max_v, test_v, dummy_form, dummy_field):
"""
It should raise ValidationErr... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_number_range_raises[5-10-None] | true | @pytest.mark.parametrize(
"min_v, max_v, test_v",
[
(5, 10, None),
(5, 10, 0),
(5, 10, 12),
(5, 10, -5),
(5, None, 4),
(None, 100, 500),
],
)
def test_number_range_raises(min_v, max_v, test_v, dummy_form, dummy_field):
"""
It should raise ValidationErr... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_number_range_raises[5-None-4] | true | @pytest.mark.parametrize(
"min_v, max_v, test_v",
[
(5, 10, None),
(5, 10, 0),
(5, 10, 12),
(5, 10, -5),
(5, None, 4),
(None, 100, 500),
],
)
def test_number_range_raises(min_v, max_v, test_v, dummy_form, dummy_field):
"""
It should raise ValidationErr... | BSD-3-Clause |
wtforms__wtforms-614 | tests/test_validators.py::test_number_range_raises[None-100-500] | true | @pytest.mark.parametrize(
"min_v, max_v, test_v",
[
(5, 10, None),
(5, 10, 0),
(5, 10, 12),
(5, 10, -5),
(5, None, 4),
(None, 100, 500),
],
)
def test_number_range_raises(min_v, max_v, test_v, dummy_form, dummy_field):
"""
It should raise ValidationErr... | BSD-3-Clause |