  
      def test_valid_self_referential_generic_relationship(self):
          class Model(models.Model):
              rel = GenericRelation('Model')
              content_type = models.ForeignKey(ContentType)
              object_id = models.PositiveIntegerField()
              content_object = GenericForeignKey(
                  'content_type', 'object_id')
  
          errors = Model.rel.field.check()
 
</s> remove             content_type = models.ForeignKey(ContentType)
 </s> add             content_type = models.ForeignKey(ContentType, models.CASCADE) </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     content_type = models.ForeignKey(ContentType)
 </s> add     content_type = models.ForeignKey(ContentType, models.CASCADE) </s> remove     content_type = models.ForeignKey(ContentType)
 </s> add     content_type = models.ForeignKey(ContentType, models.CASCADE) </s> remove     content_type = models.ForeignKey(ContentType)
 </s> add     content_type = models.ForeignKey(ContentType, models.CASCADE)
            content_type = models.ForeignKey(ContentType, models.CASCADE)
  
      def test_valid_self_referential_generic_relationship(self):
          class Model(models.Model):
              rel = GenericRelation('Model')
            content_type = models.ForeignKey(ContentType, models.CASCADE)
              object_id = models.PositiveIntegerField()
              content_object = GenericForeignKey(
                  'content_type', 'object_id')
  
          errors = Model.rel.field.check()
keep keep keep keep replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/contenttypes_tests/tests.py