Hello
First of all, I want to say a big thank to all of you for developing this amazing framework.
I've
decided to take a look at TG2 to see all the new features since TG1.
I've just made a fresh install and create a project named 'tgtest' from
paster quickstart and answered 'yes' to identity question.
As I want to use unit testing I've tried nosetests. If I'm simply running "nosetests" all tests pass, but if i'm trying
the command "nosetests --with-coverage --cover-package=tgtest" it fails
with one error and give me this traceback :
> nosetests --with-coverage --cover-package=tgtest
E
======================================================================
ERROR: Failure: AttributeError ('property' object has no attribute '_User__encrypt_password')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/local/lib/python2.5/site-packages/nose-0.10.3-py2.5.egg/nose/loader.py", line 364, in loadTestsFromName
addr.filename, addr.module)
File "/opt/local/lib/python2.5/site-packages/nose-0.10.3-py2.5.egg/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/opt/local/lib/python2.5/site-packages/nose-0.10.3-py2.5.egg/nose/importer.py", line 84, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/Developer/stef/work/perso/tgtest/tgtest/tests/__init__.py", line 33, in <module>
cmd.run([test_file])
File "/opt/local/lib/python2.5/site-packages/PasteScript-1.6.3-py2.5.egg/paste/script/appinstall.py", line 68, in run
return super(AbstractInstallCommand, self).run(new_args)
File "/opt/local/lib/python2.5/site-packages/PasteScript-1.6.3-py2.5.egg/paste/script/command.py", line 213, in run
result = self.command()
File "/opt/local/lib/python2.5/site-packages/PasteScript-1.6.3-py2.5.egg/paste/script/appinstall.py", line 456, in command
self, config_file, section, self.sysconfig_install_vars(installer))
File "/opt/local/lib/python2.5/site-packages/PasteScript-1.6.3-py2.5.egg/paste/script/appinstall.py", line 600, in setup_config
mod.setup_config(command, filename, section, vars)
File "/Developer/stef/work/perso/tgtest/tgtest/websetup.py", line 21, in setup_config
u = model.User()
File "<string>", line 4, in __init__
File "/opt/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/attributes.py", line 815, in initialize_instance
fn(self, instance, args, kwargs)
File "/opt/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/mapper.py", line 1678, in _event_on_init
instrumenting_mapper.compile()
File "/opt/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/mapper.py", line 369, in compile
mapper.__initialize_properties()
File "/opt/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/mapper.py", line 390, in __initialize_properties
prop.init(key, self)
File "/opt/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/interfaces.py", line 384, in init
self.do_init()
File "/opt/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/properties.py", line 207, in do_init
None, None, False, comparator_callable, proxy_property=self.descriptor)
File "/opt/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/strategies.py", line 45, in _register_attribute
active_history=active_history
File "/opt/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/unitofwork.py", line 87, in register_attribute
return attributes.register_attribute(class_, key, *args, **kwargs)
File "/opt/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/attributes.py", line 1460, in register_attribute
descriptor = proxy_type(key, proxy_property, comparator, parententity)
File "/opt/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/attributes.py", line 156, in __init__
self.descriptor = self.user_prop = descriptor
File "/Developer/stef/work/perso/tgtest/tgtest/model/identity.py", line 102, in _set_password
self._password = self.__encrypt_password(algorithm, password)
File "/opt/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc1-py2.5.egg/sqlalchemy/orm/attributes.py", line 184, in __getattr__
return getattr(descriptor, attribute)
AttributeError: 'property' object has no attribute '_User__encrypt_password'
Name Stmts Exec Cover Missing
---------------------------------------------------------
tgtest 0 0 100%
tgtest.config 0 0 100%
tgtest.config.app_cfg 21 21 100%
tgtest.config.environment 2 2 100%
tgtest.config.middleware 6 6 100%
tgtest.controllers 0 0 100%
tgtest.lib 0 0 100%
tgtest.lib.app_globals 3 3 100%
tgtest.lib.helpers 1 1 100%
tgtest.model 10 10 100%
tgtest.model.identity 68 43 63% 50, 72, 77-80, 87, 94, 107, 116-149, 154-158
tgtest.templates 0 0 100%
tgtest.websetup 38 13 34% 22-55
---------------------------------------------------------
TOTAL 149 99 66%
----------------------------------------------------------------------
Ran 1 test in 0.876s
FAILED (errors=1)
Am I doing something wrong?
It is a fresh install of python-2.5 with no previous turbogears installation.
I've upgraded SQLAlchemy from 0.5.0-beta3 to 0.5.0rc1 and tg.devtools from 1.9.7a4 to 1.9.7a4dev-r5288 to see if the problem could be resolved by simply upgrading.
Stef.