def test_key_replaced_by_oob_insert(self):
        users, User = self.tables.users, self.classes.User

        mapper(User, users)

        u1 = User(name='u1')

        s = Session()
        s.add(u1)
        s.commit()

        s.delete(u1)
        s.flush()

        s.execute(users.insert().values(name='u1'))
        u2 = s.query(User).get('u1')

        assert u1 not in s
        s.rollback()

        assert s in u1
        assert u2 not in s

        assert s.identity_map[(User, ('u1',))] is u1
dataset/ETHPy150Open zzzeek/sqlalchemy/test/orm/test_transaction.py/NaturalPKRollbackTest.test_key_replaced_by_oob_insert/swapped operands of `in`