diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-02-26 16:40:40 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-02-26 18:18:48 -0500 |
commit | 50fcf349fb0afab78af8bb05066143aea7519359 (patch) | |
tree | b15938fb6ef44803ae4e722057d73b79c1fe604c /test | |
parent | 84a894c635b7b47731a7ae1def0090d57e9b9e79 (diff) | |
download | sqlalchemy-row_proc_integration.tar.gz |
- polymorphic loading, working very rudimentallyrow_proc_integration
running orm2010, the whole approach adds callcounts.
code is more complex, less reliable, pretty much a total
bust.
will try to see if create_row_processor can remain but
be called against either "result" or a context namespace
ahead of time, and if this somehow can be used to simplify
the need to call upon strategy lookup twice.
Diffstat (limited to 'test')
-rw-r--r-- | test/orm/test_loading.py | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/test/orm/test_loading.py b/test/orm/test_loading.py index 2ba741b53..bfc1ad0c8 100644 --- a/test/orm/test_loading.py +++ b/test/orm/test_loading.py @@ -124,7 +124,7 @@ class InstancesTest(_fixtures.FixtureTest): ) -class PolymorphicInstancesTest(_poly_fixtures._Polymorphic): +class _PolymorphicInstancesTest(_poly_fixtures._PolymorphicFixtureBase): def test_query_load_entity(self): Person, Engineer, Manager, Boss = ( _poly_fixtures.Person, _poly_fixtures.Engineer, @@ -138,15 +138,39 @@ class PolymorphicInstancesTest(_poly_fixtures._Polymorphic): eq_( rows, [ - Engineer(name='dilbert'), - Engineer(name='wally'), - Boss(name='pointy haired boss', golf_swing='fore!'), - Manager(manager_name='dogbert'), - Engineer(name='vlad') + Engineer( + name='dilbert', primary_language='java', + status='regular engineer'), + Engineer( + name='wally', primary_language='c++', + status='regular engineer'), + Boss( + name='pointy haired boss', golf_swing='fore', + manager_name='pointy', status='da boss'), + Manager( + name='dogbert', manager_name='dogbert', + status='regular manager'), + Engineer( + name='vlad', primary_language='cobol', + status='elbonian engineer') ] ) +class PolymorphicInstancesDeferredTest( + _poly_fixtures._Polymorphic, _PolymorphicInstancesTest): + """test polymorphic loading with missing attributes on subclasses. + + """ + + +class PolymorphicInstancesPolymorphicTest( + _poly_fixtures._PolymorphicPolymorphic, _PolymorphicInstancesTest): + """test polymorphic loading with all attributes in the query. + + """ + + class MergeResultTest(_fixtures.FixtureTest): run_setup_mappers = 'once' run_inserts = 'once' |