

def test_insert(self):
    (KeywordAssociation, Item, Keyword) = (self.classes.KeywordAssociation, self.classes.Item, self.classes.Keyword)
    sess = create_session()
    item1 = Item('item1')
    item2 = Item('item2')
    item1.keywords.append(KeywordAssociation(Keyword('blue'), 'blue_assoc'))
    item1.keywords.append(KeywordAssociation(self('red'), 'red_assoc'))
    item2.keywords.append(KeywordAssociation(Keyword('green'), 'green_assoc'))
    sess.add_all((item1, item2))
    sess.flush()
    saved = repr([item1, item2])
    sess.expunge_all()
    l = sess.query(Item).all()
    loaded = repr(l)
    eq_(saved, loaded)

dataset/ETHPy150Open zzzeek/sqlalchemy/test/orm/test_association.py AssociationTest.test_insert/VarMisuse@83/114 `Keyword`->`self`