

def test_multipath_joins():
    (app, db, admin) = setup()

    class Model1(db.Model):
        id = db.Column(db.Integer, primary_key=True)
        val1 = db.Column(db.String(20))
        test = db.Column(db.String(20))

    class Model2(db.Model):
        id = db.Column(db.Integer, primary_key=True)
        val2 = db.Column(db.String(20))
        first_id = db.Column(db.Integer, db.ForeignKey(Model1.id))
        first = db.relationship(Model1, backref='first', foreign_keys=[first_id])
        second_id = db.Column(db.Integer, db.ForeignKey(Model1.id))
        second = db.relationship(Model1, backref='second', foreign_keys=[second_id])
    db.create_all()
    view = CustomModelView(Model2, db.session, filters=['first.test'])
    admin.add_view(view)
    client = app.test_client()
    rv = client.get('/admin/model2/')
    eq_(rv.status_code, 200)

dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/tests/sqla/test_basic.py test_multipath_joins/original