  class B2(models.Model):
      delete_top = models.ForeignKey(DeleteTop, models.CASCADE)
  
  
  class DeleteBottom(models.Model):
      b1 = models.ForeignKey(B1, models.RESTRICT)
      b2 = models.ForeignKey(B2, models.CASCADE)
  
  
 
</s> remove             "referenced through a restricted foreign key: 'DeleteBottom.b1'."
 </s> add             "referenced through restricted foreign keys: 'DeleteBottom.b1'." </s> remove             "Cannot delete some instances of model 'R' because they are "
            "referenced through a restricted foreign key: 'A.restrict'."
 </s> add             "Cannot delete some instances of model 'P' because they are "
            "referenced through restricted foreign keys: 'A.restrict'." </s> remove             "referenced through a restricted foreign key: 'A.restrict'."
 </s> add             "referenced through restricted foreign keys: 'A.restrict'."
        )
        with self.assertRaisesMessage(RestrictedError, msg):
            a.restrict.delete()

    def test_restrict_multiple(self):
        a = create_a('restrict')
        B3.objects.create(restrict=a.restrict)
        msg = (
            "Cannot delete some instances of model 'R' because they are "
            "referenced through restricted foreign keys: 'A.restrict', "
            "'B3.restrict'." </s> remove     B1, B2, MR, A, Avatar, B, Base, Child, DeleteBottom, DeleteTop, GenericB1,
    GenericB2, GenericDeleteBottom, HiddenUser, HiddenUserProfile, M, M2MFrom,
    M2MTo, MRNull, Origin, P, Parent, R, RChild, RChildChild, Referrer, S, T,
    User, create_a, get_default_r,
 </s> add     B1, B2, B3, MR, A, Avatar, B, Base, Child, DeleteBottom, DeleteTop,
    GenericB1, GenericB2, GenericDeleteBottom, HiddenUser, HiddenUserProfile,
    M, M2MFrom, M2MTo, MRNull, Origin, P, Parent, R, RChild, RChildChild,
    Referrer, S, T, User, create_a, get_default_r, </s> remove             "are referenced through a restricted foreign key: "
 </s> add             "are referenced through restricted foreign keys: "
class B3(models.Model):
    restrict = models.ForeignKey(R, models.RESTRICT)


  class B2(models.Model):
      delete_top = models.ForeignKey(DeleteTop, models.CASCADE)
  
  
class B3(models.Model):
    restrict = models.ForeignKey(R, models.RESTRICT)


  class DeleteBottom(models.Model):
      b1 = models.ForeignKey(B1, models.RESTRICT)
      b2 = models.ForeignKey(B2, models.CASCADE)
  
  
keep keep keep add keep keep keep keep keep
 Refs #27852 -- Fixed object deletion to show all restricted related objects rather than just the first one. 
tests/delete/models.py