Ticket #1607: test_message.py
| File test_message.py, 422 bytes (added by alberto, 2 years ago) |
|---|
| Line | |
|---|---|
| 1 | from unittest import TestCase |
| 2 | from formencode.schema import Schema |
| 3 | from formencode.validators import FancyValidator |
| 4 | |
| 5 | class SchemaWithInstance(Schema): |
| 6 | a = FancyValidator() |
| 7 | |
| 8 | class SchemaWithClass(Schema): |
| 9 | a = FancyValidator() |
| 10 | |
| 11 | class TestMySchema(TestCase): |
| 12 | def test_class(self): |
| 13 | SchemaWithInstance.to_python(dict(a="a")) |
| 14 | |
| 15 | def test_instance(self): |
| 16 | SchemaWithClass.to_python(dict(a="a")) |