form = open("form_deep_structure_template.html").read() form = PeppercornForm(form, data=validated_data) form.validate() # XXX the following fails because nested lists end up copying # templates when they shouldn't -- see 'parse_list' method of # transformer rendered = etree.fromstring(form.transform()) expected = rendered.xpath('//*[@class="error-message"]')[3] self.assertEqual(expected.text, 'is required') def test_different_schema_types(self): """Ensure we can refer to schemas by name or by instance """ schema = schemaish.Structure() transformer.schema_registry = {'myschema': schema} example1 = {'schema': 'myschema', 'data': {}} example2 = {'schema': schema, 'data': {}} # both of these should work get_validated(example1) get_validated(example2) def runTest(self): self.test_something() if __name__ == "__main__": test = TestCase() test.runTest()