From e0d2cc3fdb3d1547e16f92093fa8c5c82127681e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 1 Feb 2006 23:21:57 +0000 Subject: [PATCH] unit tests for merged cylical code --- test/cycles.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/cycles.py b/test/cycles.py index 96ba1e264f..fa3538b04a 100644 --- a/test/cycles.py +++ b/test/cycles.py @@ -9,6 +9,8 @@ import tables objectstore.LOG = True +"""test cyclical mapper relationships. No assertions yet, but run it with postgres and the +foreign key checks alone will usually not work if something is wrong""" class Tester(object): def __init__(self, data=None): self.data = data @@ -35,8 +37,8 @@ class SelfCycleTest(AssertMixin): t1.create() t2.create() def tearDownAll(self): - t1.drop() t2.drop() + t1.drop() def setUp(self): objectstore.clear() clear_mappers() @@ -48,8 +50,8 @@ class SelfCycleTest(AssertMixin): pass m1 = mapper(C1, t1, properties = { - 'c1s' : relation(C1), - 'c2s' : relation(C2, t2) + 'c1s' : relation(C1, private=True), + 'c2s' : relation(C2, t2, private=True) }) a = C1('head c1') @@ -61,6 +63,9 @@ class SelfCycleTest(AssertMixin): a.c1s[1].c2s.append(C2('child2 data2')) objectstore.commit() + objectstore.delete(a) + objectstore.commit() + class CycleTest(AssertMixin): """tests two mappers with a bi-directional dependency""" def setUpAll(self): -- 2.47.2