Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.
| File test_message.py,
422 bytes
(added by alberto, 5 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")) |
|---|
| 17 | |
|---|
Download in other formats: