From d34584032171a57572ada8b762253769990b946f Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 18 Feb 2006 23:44:37 +0000 Subject: [PATCH] beginning of a row cycle test --- test/cycles.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/cycles.py b/test/cycles.py index 556008998c..69f632f1f4 100644 --- a/test/cycles.py +++ b/test/cycles.py @@ -228,6 +228,28 @@ class CycleTest2(AssertMixin): p.balls.append(b) objectstore.commit() + def testrowcycle(self): + """tests a cycle between two rows""" + class Person(object): + pass + + class Ball(object): + pass + + Ball.mapper = mapper(Ball, ball) + Person.mapper = mapper(Person, person, properties= dict( + balls = relation(Ball.mapper, primaryjoin=ball.c.person_id==person.c.id, foreignkey=ball.c.person_id), + favorateBall = relation(Ball.mapper, primaryjoin=person.c.favoriteBall_id==ball.c.id, foreignkey=person.c.favoriteBall_id), + ) + ) + + print str(Person.mapper.props['balls'].primaryjoin) + + b = Ball() + p = Person() + p.balls.append(b) + p.favorateBall = b + #objectstore.commit() if __name__ == "__main__": -- 2.47.2