def test_query_rel_fields(self):
        client = self.app.test_client()
        rv = self.login(client, DEFAULT_ADMIN_USER, DEFAULT_ADMIN_PASSWORD)
        self.insert_data2()

        # Base filter string starts with
        rv = client.get('/model2view/add')
        data = rv.data.decode('utf-8')
        ok_('G1' in data)
        ok_('G2' not in data)

        # Base filter string starts with
        rv = client.get('/model2view/edit/1')
        data = rv.data.decode('utf-8')
        ok_('G2' in data)
        ok_('G1' not in data)
Test add and edit form related fields filter
dataset/ETHPy150Open dpgaspar/Flask-AppBuilder/flask_appbuilder/tests/test_base.py/FlaskTestCase.test_query_rel_fields