                       stdout=out)
          output = out.getvalue()
          error_message = "inspectdb generated an attribute name which is a python keyword"
          # Recursive foreign keys should be set to 'self'
          self.assertIn("parent = models.ForeignKey('self')", output)
          self.assertNotIn("from = models.ForeignKey(InspectdbPeople)", output, msg=error_message)
          # As InspectdbPeople model is defined after InspectdbMessage, it should be quoted
          self.assertIn("from_field = models.ForeignKey('InspectdbPeople', db_column='from_id')",
                        output)
          self.assertIn("people_pk = models.ForeignKey(InspectdbPeople, primary_key=True)",
                        output)
 
</s> remove         self.assertIn("from_field = models.ForeignKey('InspectdbPeople', db_column='from_id')",
                      output)
        self.assertIn("people_pk = models.ForeignKey(InspectdbPeople, primary_key=True)",
                      output)
        self.assertIn("people_unique = models.ForeignKey(InspectdbPeople, unique=True)",
                      output)
 </s> add         self.assertIn(
            "from_field = models.ForeignKey('InspectdbPeople', models.DO_NOTHING, db_column='from_id')",
            output,
        )
        self.assertIn(
            "people_pk = models.ForeignKey(InspectdbPeople, models.DO_NOTHING, primary_key=True)",
            output,
        )
        self.assertIn(
            "people_unique = models.ForeignKey(InspectdbPeople, models.DO_NOTHING, unique=True)",
            output,
        ) </s> remove             content_type = models.ForeignKey('self')  # should point to ContentType
 </s> add             content_type = models.ForeignKey('self', models.CASCADE)  # should point to ContentType </s> remove     user = models.OneToOneField(User, primary_key=True)
 </s> add     user = models.OneToOneField(User, models.CASCADE, primary_key=True) </s> remove             field = models.ForeignKey(Target, related_name='+')
 </s> add             field = models.ForeignKey(Target, models.CASCADE, related_name='+')
        self.assertIn("parent = models.ForeignKey('self', models.DO_NOTHING)", output)
        self.assertNotIn(
            "from = models.ForeignKey(InspectdbPeople, models.DO_NOTHING)",
            output,
            msg=error_message,
        )
                       stdout=out)
          output = out.getvalue()
          error_message = "inspectdb generated an attribute name which is a python keyword"
          # Recursive foreign keys should be set to 'self'
        self.assertIn("parent = models.ForeignKey('self', models.DO_NOTHING)", output)
        self.assertNotIn(
            "from = models.ForeignKey(InspectdbPeople, models.DO_NOTHING)",
            output,
            msg=error_message,
        )
        self.assertIn("parent = models.ForeignKey('self', models.DO_NOTHING)", output)
        self.assertNotIn(
            "from = models.ForeignKey(InspectdbPeople, models.DO_NOTHING)",
            output,
            msg=error_message,
        )
          # As InspectdbPeople model is defined after InspectdbMessage, it should be quoted
          self.assertIn("from_field = models.ForeignKey('InspectdbPeople', db_column='from_id')",
                        output)
          self.assertIn("people_pk = models.ForeignKey(InspectdbPeople, primary_key=True)",
                        output)
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/inspectdb/tests.py