File: test_labels.py

package info (click to toggle)
wtforms-alchemy 0.19.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 492 kB
  • sloc: python: 3,955; makefile: 119; sh: 11
file content (20 lines) | stat: -rw-r--r-- 620 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from tests import ModelFormTestCase
from wtforms_alchemy import ModelForm


class TestFieldLabels(ModelFormTestCase):
    def test_assigns_labels_from_column_info(self):
        self.init(info={"label": "Test Column"})
        self.assert_label("test_column", "Test Column")

    def test_assigns_labels_from_form_configuration(self):
        self.init()

        class ModelTestForm(ModelForm):
            class Meta:
                model = self.ModelTest

                field_args = {"test_column": {"label": "TESTING"}}

        self.form_class = ModelTestForm
        self.assert_label("test_column", "TESTING")