From: Mike Bayer Date: Tue, 11 Apr 2006 16:59:18 +0000 (+0000) Subject: added a failing unittest for inheriting mappers with add_property X-Git-Tag: rel_0_1_6~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80ed5b5cc2034e22ddf8ad34f71ed703fdb0c6ab;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git added a failing unittest for inheriting mappers with add_property --- diff --git a/test/inheritance.py b/test/inheritance.py index 3202c34178..9478441616 100644 --- a/test/inheritance.py +++ b/test/inheritance.py @@ -374,7 +374,7 @@ class InheritTest5(testbase.AssertMixin): def testbasic(self): class ContentType(object): pass class Content(object): pass - class Product(object): pass + class Product(Content): pass content_types = mapper(ContentType, content_type) contents = mapper(Content, content, properties={ @@ -383,7 +383,22 @@ class InheritTest5(testbase.AssertMixin): #contents.add_property('content_type', relation(content_types)) #adding this makes the inheritance stop working # shouldnt throw exception products = mapper(Product, product, inherits=contents) + + def testbackref(self): + class ContentType(object): pass + class Content(object): pass + class Product(Content): pass + + # this test fails currently + contents = mapper(Content, content) + products = mapper(Product, product, inherits=contents) + content_types = mapper(ContentType, content_type, properties={ + 'content':relation(contents, backref='contenttype') + }) + p = Product() + p.contenttype = ContentType() + class InheritTest6(testbase.AssertMixin): """tests eager load/lazy load of child items off inheritance mappers, tests that LazyLoader constructs the right query condition."""