<s> from mongoengine import Document , EmbeddedDocument <EOL> from mongoengine . fields import * <EOL> from mongoforms . fields import MongoFormFieldGenerator <EOL> from testprj . tests import MongoengineTestCase <EOL> class _FieldRenderTestCase ( MongoengineTestCase ) : <EOL> field_class = None <EOL> rendered_widget = '<STR_LIT>' <EOL> is_not_implemented = False <EOL> def setUp ( self ) : <EOL> self . generator = MongoFormFieldGenerator ( ) <EOL> def get_field ( self ) : <EOL> class TestDocument ( Document ) : <EOL> test_field = self . field_class ( ) <EOL> return TestDocument . _fields [ '<STR_LIT>' ] <EOL> def get_form_field ( self ) : <EOL> return self . generator . generate ( '<STR_LIT>' , self . get_field ( ) ) <EOL> def runTest ( self ) : <EOL> if self . is_not_implemented : <EOL> self . assertRaises ( NotImplementedError , self . get_form_field ) <EOL> else : <EOL> self . assertMultiLineEqual ( <EOL> self . rendered_widget , <EOL> self . get_form_field ( ) . widget . render ( '<STR_LIT>' , None ) ) <EOL> class Test001StringFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = StringField <EOL> rendered_widget = '<STR_LIT>' <EOL> class Test002IntFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = IntField <EOL> class Test003FloatFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = FloatField <EOL> class Test004BooleanFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = BooleanField <EOL> rendered_widget = '<STR_LIT>' <EOL> class Test005DateTimeFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = DateTimeField <EOL> class Test006EmbeddedDocumentFieldRender ( _FieldRenderTestCase ) : <EOL> is_not_implemented = True <EOL> def get_field ( self ) : <EOL> class TestEmbeddedDocument ( EmbeddedDocument ) : <EOL> pass <EOL> class TestDocument ( Document ) : <EOL> test_field = EmbeddedDocumentField ( TestEmbeddedDocument ) <EOL> return TestDocument . _fields [ '<STR_LIT>' ] <EOL> class Test007ListFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = ListField <EOL> is_not_implemented = True <EOL> class Test008DictFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = DictField <EOL> is_not_implemented = True <EOL> class Test009ObjectIdFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = ObjectIdField <EOL> is_not_implemented = True <EOL> class Test010ReferenceFieldRender ( _FieldRenderTestCase ) : <EOL> rendered_widget = '<STR_LIT>' <EOL> def get_field ( self ) : <EOL> class TestDocument ( Document ) : <EOL> test_field = ReferenceField ( '<STR_LIT>' ) <EOL> return TestDocument . _fields [ '<STR_LIT>' ] <EOL> class Test011MapFieldRender ( _FieldRenderTestCase ) : <EOL> is_not_implemented = True <EOL> def get_field ( self ) : <EOL> class TestDocument ( Document ) : <EOL> test_field = MapField ( StringField ( ) ) <EOL> return TestDocument . _fields [ '<STR_LIT>' ] <EOL> class Test012DecimalFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = DecimalField <EOL> class Test013ComplexDateTimeFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = ComplexDateTimeField <EOL> is_not_implemented = True <EOL> class Test014URLFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = URLField <EOL> class Test015GenericReferenceFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = GenericReferenceField <EOL> is_not_implemented = True <EOL> class Test016FileFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = FileField <EOL> is_not_implemented = True <EOL> class Test017BinaryFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = BinaryField <EOL> is_not_implemented = True <EOL> class Test018SortedListFieldRender ( _FieldRenderTestCase ) : <EOL> is_not_implemented = True <EOL> def get_field ( self ) : <EOL> class TestDocument ( Document ) : <EOL> test_field = SortedListField ( StringField ) <EOL> return TestDocument . _fields [ '<STR_LIT>' ] <EOL> class Test019EmailFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = EmailField <EOL> class Test020GeoPointFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = GeoPointField <EOL> is_not_implemented = True <EOL> class Test021ImageFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = ImageField <EOL> is_not_implemented = True <EOL> class Test022SequenceFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = SequenceField <EOL> is_not_implemented = True <EOL> class Test023UUIDFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = UUIDField <EOL> is_not_implemented = True <EOL> class Test024GenericEmbeddedDocumentFieldRender ( _FieldRenderTestCase ) : <EOL> field_class = GenericEmbeddedDocumentField <EOL> is_not_implemented = True </s>
