def test_related_view_edit_with_excluded_search(self):
        """
        Test related edit view with excluded search field
        """
        with self.app.test_client() as client:
            self.browser_login(client, USERNAME_ADMIN, PASSWORD_ADMIN)
            with model2_data(self.appbuilder.session, 3) as models:
                model_id = models[0].id
                # Test excluded search field will not impact related view
                rv = client.get(f"/model2view/edit/{model_id}?_flt_0_group=1")
                data = rv.data.decode("utf-8")
                self.assertNotIn('<label for="group"', data)

                # Test direct edit view includes related field
                rv = client.get(f"/model2view/edit/{model_id}")
                data = rv.data.decode("utf-8")
                self.assertIn('<label for="group"', data)

        Test related edit view with excluded search field
        
tests/test_mvc.py