File: test_passive_hidden_field.py

package info (click to toggle)
wtforms-components 0.11.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 352 kB
  • sloc: python: 1,582; makefile: 135; sh: 11
file content (19 lines) | stat: -rw-r--r-- 462 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from wtforms import Form
from wtforms_test import FormTestCase

from tests import MultiDict
from wtforms_components import PassiveHiddenField


class TestPassiveHiddenField(FormTestCase):
    def test_does_not_populate_obj_values(self):
        class MyForm(Form):
            id = PassiveHiddenField()

        class A:
            id = None

        form = MyForm(MultiDict({"id": 12}))
        a = A()
        form.populate_obj(a)
        assert a.id is None