#NEWLINE# @ skipUnlessDBFeature ( 'can_introspect_foreign_keys' ) #NEWLINE# def test_attribute_name_not_python_keyword( self ) : #NEWLINE# #INDENT# out = StringIO ( ) #NEWLINE# call_command ( 'inspectdb' , table_name_filter = ( lambda tn : tn . startswith ( 'inspectdb_' ) ) , stdout = out ) #NEWLINE# output = out . getvalue ( ) #NEWLINE# error_message = 'inspectdb generated an attribute name which is a python keyword' #NEWLINE# self . assertNotIn ( 'from = models.ForeignKey(InspectdbPeople)' , output , msg = out ) #NEWLINE# self . assertIn ( "from_field = models.ForeignKey('InspectdbPeople', db_column='from_id')" , output ) #NEWLINE# self . assertIn ( 'people_pk = models.ForeignKey(InspectdbPeople, primary_key=True)' , output ) #NEWLINE# self . assertIn ( 'people_unique = models.ForeignKey(InspectdbPeople, unique=True)' , output )