def test_get_field(self):
    (columns, primary_keys, foreign_keys, model_names, indexes) = self.introspector.introspect()
    expected = (('col_types', (('f1', ('f1 = BigIntegerField(index=True)', 'f1 = IntegerField(index=True)')), ('f2', ('f2 = BlobField()', 'f2 = TextField()')), ('f4', 'f4 = CharField()'), ('f5', 'f5 = DateField()'), ('f6', 'f6 = DateTimeField()'), ('f7', 'f7 = DecimalField()'), ('f10', 'f10 = IntegerField(unique=True)'), ('f11', 'f11 = AutoField()'), ('f12', ('f12 = TextField()', 'f12 = BlobField()')), ('f13', 'f13 = TimeField()'))), ('nullable', (('nullable_cf', 'nullable_cf = CharField(null=True)'), ('nullable_if', 'nullable_if = IntegerField(null=True)'))), ('fkpk', (('col_types_id', "col_types = ForeignKeyField(column_name='col_types_id', field='f11', model=ColTypes, primary_key=True)"),)), ('nugget', (('category_id', "category_id = ForeignKeyField(column_name='category_id', field='id', model=Category)"), ('category', 'category = CharField()'))), ('rel_model', (('col_types_id', "col_types = ForeignKeyField(column_name='col_types_id', field='f11', model=ColTypes)"), ('col_types_nullable_id', "col_types_nullable = ForeignKeyField(backref='col_types_col_types_nullable_set', column_name='col_types_nullable_id', field='f11', model=ColTypes, null=True)"))), ('underscores', (('_id', '_id = AutoField()'), ('_name', '_name = CharField()'))), ('category', (('name', 'name = CharField()'), ('parent_id', "parent = ForeignKeyField(column_name='parent_id', field='id', model='self', null=True)"))))
    for (table, field_data) in expected:
        for (field_name, fields) in field_data:
            if (not isinstance(fields, tuple)):
                fields = (fields,)
            actual = columns[table][field_name].get_field()
            self.assertTrue((actual in fields), ('%s not in %s' % (actual, fields)))
def test_get_field(self):
    (columns, primary_keys, foreign_keys, model_names, indexes) = self.introspector.introspect()
    expected = (('col_types', (('f1', ('f1 = BigIntegerField(index=True)', 'f1 = IntegerField(index=True)')), ('f2', ('f2 = BlobField()', 'f2 = TextField()')), ('f4', 'f4 = CharField()'), ('f5', 'f5 = DateField()'), ('f6', 'f6 = DateTimeField()'), ('f7', 'f7 = DecimalField()'), ('f10', 'f10 = IntegerField(unique=True)'), ('f11', 'f11 = AutoField()'), ('f12', ('f12 = TextField()', 'f12 = BlobField()')), ('f13', 'f13 = TimeField()'))), ('nullable', (('nullable_cf', 'nullable_cf = CharField(null=True)'), ('nullable_if', 'nullable_if = IntegerField(null=True)'))), ('fkpk', (('col_types_id', "col_types = ForeignKeyField(column_name='col_types_id', field='f11', model=ColTypes, primary_key=True)"),)), ('nugget', (('category_id', "category_id = ForeignKeyField(column_name='category_id', field='id', model=Category)"), ('category', 'category = CharField()'))), ('rel_model', (('col_types_id', "col_types = ForeignKeyField(column_name='col_types_id', field='f11', model=ColTypes)"), ('col_types_nullable_id', "col_types_nullable = ForeignKeyField(backref='col_types_col_types_nullable_set', column_name='col_types_nullable_id', field='f11', model=ColTypes, null=True)"))), ('underscores', (('_id', '_id = AutoField()'), ('_name', '_name = CharField()'))), ('category', (('name', 'name = CharField()'), ('parent_id', "parent = ForeignKeyField(column_name='parent_id', field='id', model='self', null=True)"))))
    for (table, field_data) in expected:
        for (field_name, fields) in field_data:
            if (not isinstance(fields, tuple)):
                fields = (fields,)
            actual = columns[table][field_name].get_field()
            self.assertTrue((actual in fields), ('%s not in %s' % (actual, fields)))