From: Jason Kirtland Date: Mon, 11 Feb 2008 19:14:38 +0000 (+0000) Subject: - Fixed .get() of a String PK (exposed by pg 8.3) X-Git-Tag: rel_0_4_3~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=645fa5255d899431d489b89d1c567bce96c1bb4d;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Fixed .get() of a String PK (exposed by pg 8.3) --- diff --git a/test/orm/assorted_eager.py b/test/orm/assorted_eager.py index 92637bc796..af3fcbc7bb 100644 --- a/test/orm/assorted_eager.py +++ b/test/orm/assorted_eager.py @@ -460,17 +460,17 @@ class EagerTest5(ORMTest): derivedMapper = mapper(Derived, derived, inherits=baseMapper) derivedIIMapper = mapper(DerivedII, derivedII, inherits=baseMapper) sess = create_session() - d = Derived(1, 'x', 'y') - d.comments = [Comment(1, 'comment')] - d2 = DerivedII(2, 'xx', 'z') - d2.comments = [Comment(2, 'comment')] + d = Derived('uid1', 'x', 'y') + d.comments = [Comment('uid1', 'comment')] + d2 = DerivedII('uid2', 'xx', 'z') + d2.comments = [Comment('uid2', 'comment')] sess.save(d) sess.save(d2) sess.flush() sess.clear() # this eager load sets up an AliasedClauses for the "comment" relationship, # then stores it in clauses_by_lead_mapper[mapper for Derived] - d = sess.query(Derived).get(1) + d = sess.query(Derived).get('uid1') sess.clear() assert len([c for c in d.comments]) == 1 @@ -478,7 +478,7 @@ class EagerTest5(ORMTest): # and should store it in clauses_by_lead_mapper[mapper for DerivedII]. # the bug was that the previous AliasedClause create prevented this population # from occurring. - d2 = sess.query(DerivedII).get(2) + d2 = sess.query(DerivedII).get('uid2') sess.clear() # object is not in the session; therefore the lazy load cant trigger here, # eager load had to succeed