def test_m2m_selfref(self):
        person_table = Table('person', metadata,
            Column('id', Integer, primary_key=True),
            Column('name', String(32)))

        person_person_table = Table('person_person', metadata,
            Column('person_id1', Integer, ForeignKey('person.id')),
            Column('person_id2', Integer, ForeignKey('person.id')))

        metadata.create_all()
        metadata.clear()

        class Person(Entity):
            appreciate = ManyToMany('Person',
                                    tablename='person_person',
                                    local_colname='person_id1')
            isappreciatedby = ManyToMany('Person',
                                         tablename='person_person',
                                         # this one is not necessary
                                         local_colname='person_id2')

        setup_all()

        barney = Person(name="Barney")
        homer = Person(name="Homer", appreciate=[barney])

        session.commit()
        session.expunge_all()

        homer = Person.get_by(name="Homer")
        barney = Person.get_by(name="Barney")

        assert homer.appreciate in barney
        assert homer in barney.isappreciatedby

    # ----------------
    # overrides tests
    # ----------------
dataset/ETHPy150Open jmg/elixir/tests/test_autoload.py/TestAutoload.test_m2m_selfref/swapped operands of `in`