From 4a79bc578c67297c707a00d8fafaba533e2833d9 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 11 Feb 2014 19:55:34 -0500 Subject: - 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. --- lib/sqlalchemy/testing/entities.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/testing/entities.py') 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 -- cgit v1.2.1