File: test_color.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 (14 lines) | stat: -rw-r--r-- 423 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from wtforms import widgets
from wtforms.fields import ColorField
from wtforms.form import Form


class F(Form):
    a = ColorField(widget=widgets.ColorInput(), default="#ff0000")
    b = ColorField(default="#00ff00")


def test_color_field():
    form = F()
    assert form.a() == """<input id="a" name="a" type="color" value="#ff0000">"""
    assert form.b() == """<input id="b" name="b" type="color" value="#00ff00">"""