Add instructions to install nose adn NB that it won't happen by magic
This commit is contained in:
parent
a6480a2c31
commit
a5c9696a7c
|
@ -13,6 +13,13 @@ http://somethingaboutorange.com/mrl/projects/nose/0.11.1/index.html
|
|||
SQLAlchemy implements a nose plugin that must be present when tests are run.
|
||||
This plugin is available when SQLAlchemy is installed via setuptools.
|
||||
|
||||
NB: You will need to manually install nose, it is unlikely to be pulled
|
||||
down as a dependency of installing SQLAlchemy.
|
||||
|
||||
Nose can be installed with:
|
||||
|
||||
$ easy_install nose
|
||||
|
||||
INSTANT TEST RUNNER
|
||||
-------------------
|
||||
|
||||
|
|
|
@ -2101,6 +2101,27 @@ class DeclarativeMixinTest(DeclarativeTestBase):
|
|||
assert class_mapper(Person).polymorphic_on is Person.__table__.c.type
|
||||
eq_(class_mapper(Engineer).polymorphic_identity, 'Engineer')
|
||||
|
||||
def test_mapper_args_classproperty_three(self):
|
||||
|
||||
class Person(Base):
|
||||
__tablename__ = 'people'
|
||||
id = Column(Integer, primary_key=True)
|
||||
discriminator = Column('type', String(50))
|
||||
@classproperty
|
||||
def __mapper_args__(cls):
|
||||
if cls.__name__=='Person':
|
||||
return dict(polymorphic_on=cls.discriminator)
|
||||
else:
|
||||
return dict(polymorphic_identity=cls.__name__)
|
||||
|
||||
class Engineer(Person):
|
||||
pass
|
||||
|
||||
compile_mappers()
|
||||
|
||||
assert class_mapper(Person).polymorphic_on is Person.__table__.c.type
|
||||
eq_(class_mapper(Engineer).polymorphic_identity, 'Engineer')
|
||||
|
||||
def test_table_args_composite(self):
|
||||
|
||||
class MyMixin1:
|
||||
|
|
Loading…
Reference in New Issue