diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-02-11 19:55:34 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-02-11 19:55:34 -0500 |
commit | 4a79bc578c67297c707a00d8fafaba533e2833d9 (patch) | |
tree | 808a412724a8137a95472ba974def1073ea1a301 /lib/sqlalchemy/testing/entities.py | |
parent | 0050a8d3db04767b97e48f3aa71381b786481231 (diff) | |
download | sqlalchemy-4a79bc578c67297c707a00d8fafaba533e2833d9.tar.gz |
- Fixed bug where :class:`.AbstractConcreteBase` would fail to be
fully usable within declarative relationship configuration, as its
string classname would not be available in the registry of classnames
at mapper configuration time. The class now explicitly adds itself
to the class regsitry, and additionally both :class:`.AbstractConcreteBase`
as well as :class:`.ConcreteBase` set themselves up *before* mappers
are configured within the :func:`.configure_mappers` setup, using
the new :meth:`.MapperEvents.before_configured` event. [ticket:2950]
- Added new :meth:`.MapperEvents.before_configured` event which allows
an event at the start of :func:`.configure_mappers`, as well
as ``__declare_first__()`` hook within declarative to complement
``__declare_last__()``.
- modified how after_configured is invoked; we just make a dispatch()
not actually connected to any mapper. this makes it easier
to also invoke before_configured correctly.
- improved the ComparableEntity fixture to handle collections that are sets.
Diffstat (limited to 'lib/sqlalchemy/testing/entities.py')
-rw-r--r-- | lib/sqlalchemy/testing/entities.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sqlalchemy/testing/entities.py b/lib/sqlalchemy/testing/entities.py index 0553e0e22..9309abfd8 100644 --- a/lib/sqlalchemy/testing/entities.py +++ b/lib/sqlalchemy/testing/entities.py @@ -85,8 +85,12 @@ class ComparableEntity(BasicEntity): return False if hasattr(value, '__iter__'): - if list(value) != list(battr): - return False + if hasattr(value, '__getitem__') and not hasattr(value, 'keys'): + if list(value) != list(battr): + return False + else: + if set(value) != set(battr): + return False else: if value is not None and value != battr: return False |