File: test_password.py

package info (click to toggle)
wtforms 3.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,064 kB
  • sloc: python: 5,264; makefile: 27; sh: 17
file content (16 lines) | stat: -rw-r--r-- 469 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from wtforms import widgets
from wtforms.fields import PasswordField
from wtforms.form import Form


class F(Form):
    a = PasswordField(
        widget=widgets.PasswordInput(hide_value=False), default="LE DEFAULT"
    )
    b = PasswordField(default="Hai")


def test_password_field():
    form = F()
    assert form.a() == """<input id="a" name="a" type="password" value="LE DEFAULT">"""
    assert form.b() == """<input id="b" name="b" type="password" value="">"""