          self.assertContains(response, '<div class="form-row hidden')
  
  
  @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
  class AdminViewOnSiteTest(TestCase):
      urls = "admin_views.urls"
      fixtures = ['admin-views-users.xml', 'admin-views-restaurants.xml']
  
      def setUp(self):
          self.client.login(username='super', password='secret')
 
</s> remove     EmptyModelVisible, EmptyModelMixin, State, City, Restaurant, Worker)
 </s> add     EmptyModelVisible, EmptyModelMixin, State, City, Restaurant, Worker,
    ParentWithDependentChildren, DependentChild) </s> remove     Telegram, Pizza, Topping, FilteredManager, City, Restaurant, Worker)
 </s> add     Telegram, Pizza, Topping, FilteredManager, City, Restaurant, Worker,
    ParentWithDependentChildren)
class AdminViewOnSiteTests(TestCase):
          self.assertContains(response, '<div class="form-row hidden')
  
  
  @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class AdminViewOnSiteTests(TestCase):
      urls = "admin_views.urls"
      fixtures = ['admin-views-users.xml', 'admin-views-restaurants.xml']
  
      def setUp(self):
          self.client.login(username='super', password='secret')
keep keep keep keep replace keep keep keep keep keep
 Fixed #20522 - Allowed use of partially validated object in ModelAdmin.add_view formset validation.

Updated ModelAdmin to use form.instance when passing parent model to
child inlines for add_view. There is effectively no change in the
change_view since the previously passed 'obj' is the same as form.instance.

Thanks to meshy for report, and EvilDMP and timo for review. 
tests/admin_views/tests.py