'Introspection of column names containing special characters,
unsuitable for Python identifiers'

def test_special_column_name_introspection(self):

    out = StringIO()
    call_command(u'inspectdb', stdout=out)
    output = out.getvalue()
    base_name = (u'Field' if (connection.vendor != u'oracle') else u'field')
    self.assertIn(u'field    =    models.IntegerField()', output)
    self.assertIn((u"field_field    =    models.IntegerField(db_column='%s_')" % base_name), output)
    self.assertIn((u"field_field_0    =    models.IntegerField(db_column='%s__')" % base_name), output)
    self.assertIn(u"field_field_1    =    models.IntegerField(db_column='__field')", output)
    self.assertIn(u"prc_x    =    models.IntegerField(db_column='prc(%)    x')", output)
    if PY3:
        self.assertIn(u'tama\xf1o    =    models.IntegerField()', output)
    else:
        self.assertIn(u"tama_o    =    models.IntegerField(db_column='tama\\xf1o')", output)
