File: test_boolean_field.py

package info (click to toggle)
wtforms-json 0.3.5-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 260 kB
  • sloc: python: 819; makefile: 140; sh: 11
file content (11 lines) | stat: -rw-r--r-- 308 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
import pytest
from wtforms import BooleanField, Form


class TestBooleanField(object):
    @pytest.mark.parametrize('value', ('', 'false', False))
    def test_falsy_value(self, value):
        class MyForm(Form):
            a = BooleanField()

        assert MyForm.from_json({'a': value}).a.data is False