Hey Ben,
Thanks for the quick response. I tried getting it to work with what
you said, but it was still giving me problems. As it turns out, we
were actually able to get pylons 0.9.6.1 approved (I had written it
down for submission a few weeks ago, but didn't think we'd actually
get it approved yet).
Anyway, I installed the latest and greatest version, fixed the
deprecatedness, and ready to roll.
I got it nose to run, but it's spitting out "table doesn't exist"
errors.
I'm running nose on the cmd line like this:
python setup.py nosetests
I updated my setup.cfg file to include:
[nosetests]
verbose=True
verbosity=2
with-pylons=test.ini
detailed-errors=1
with-doctest=False
I'm using the out-of-the-box test.ini where it has the line:
use = config:development.ini
with the additional 2 parameters below it to overwrite the
development.ini file:
sqlalchemy.default.seed_set = _test
sqlalchemy.default.dburi = mysql://root:[EMAIL PROTECTED]:3306/rosetta_test
the reason for the seed set was so that i could specify the /models/
testdata.py that I wanted to use. One being for seeding the
production/dev environment and another for the test environment that
doesn't change (the dev one may). For that reason I added the
following lines to the create_all() method in /models/__init__.py:
seed_set = app_conf.get('sqlalchemy.default.seed_set', '')
exec('from testdata'+seed_set+' import load_test_data')
(if there is a more elegant solution that would be great. I'll of
course do some checking before the exec command..yikes!)
---------------------------
I receive the following errors:
(I'm not sure why both testdata and testdata_test are being called. I
only want testdata_test to be called).
rosetta.models.testdata.load_test_data ... ERROR
rosetta.models.testdata_test.load_test_data ... ERROR
Failure: ArgumentError (Class '<class
'rosetta.models.objects.ReportTransform'>' already has a primary
mapper defined with entity name 'None'. Use non_primary=True to
create a non primary Mapper, or to create a new primary mapper, remove
this mapper first via sqlalchemy.orm.clear_mapper(mapper), or
preferably sqlalchemy.orm.clear_mappers() to clear all mappers.) ...
ERROR
======================================================================
ERROR: rosetta.models.testdata.load_test_data
----------------------------------------------------------------------
raise exceptions.SQLError(context.statement, context.parameters,
e) SQLError: (ProgrammingError) (1146, "Table 'rosetta_test.user'
doesn't exist") u'INSERT INTO `User` (last_name, first_name, nickname,
password, email, image_file_path) VALUES (%s, %s, %s, MD5(%s), %s,
%s)' ['Anthony', 'Marc', 'manthony', 'manthony', None, None]
-------------------- >> begin captured stdout << ---------------------
Adding data...
--------------------- >> end captured stdout << ----------------------
======================================================================
ERROR: rosetta.models.testdata_test.load_test_data
----------------------------------------------------------------------
ine\base.py", line 599, in _execute
raise exceptions.SQLError(context.statement, context.parameters,
e) SQLError: (ProgrammingError) (1146, "Table 'rosetta_test.user'
doesn't exist") u'INSERT INTO `User` (last_name, first_name, nickname,
password, email, image_file_path) VALUES (%s, %s, %s, MD5(%s), %s,
%s)' ['', 'TestUser3', 'testuser3', 'test', None, None]
-------------------- >> begin captured stdout << ---------------------
Adding data...
--------------------- >> end captured stdout << ----------------------
======================================================================
ERROR: Failure: ArgumentError (Class '<class
'rosetta.models.objects.ReportTransform'>' already has a primary
mapper defined with entity name 'None'. Use non_primary=True to
create a non primary Mapper, or to create a new primary mapper, remove
this mapper first via sqlalchemy.orm.clear_mapper(mapper), or
preferably sqlalchemy.orm.clear_mappers() to clear all mappers.)
----------------------------------------------------------------------
raise exceptions.ArgumentError("Class '%s' already has a primary
mapper defined with entity name '%s'. Use on_primary=True to create a
non primary Mapper, or to create a new primary mapper, remove this
mapper first via sqlalchemy.orm.clear_mapper(mapper), or preferably
sqlalchemy.orm.clear_mappers() to clear all mappers." % (self.class_,
self.entity_name)) ArgumentError: Class '<class
'rosetta.models.objects.ReportTransform'>' already has a primary
mapper defined with entity name 'None'. Use non_primary=True to
create a non primary Mapper, or to create a new primary mapper, remove
this mapper first via sqlalchemy.orm.clear_mapper(mapper), or
preferably sqlalchemy.orm.clear_mappers() to clear all mappers.
----------------------------------------------------------------------
Ran 3 tests in 0.766s
FAILED (errors=3)
On Mar 28, 2:38 pm, Ben Bangert <[EMAIL PROTECTED]> wrote:
> On Mar 28, 2008, at 2:31 PM, johnnyice wrote:
>
> > if only it were that simple. i work on a classified system and all
> > new software (even upgrades) has to go through a security code check.
> > we will be moving to the latest and greatest this summer, but not this
> > week. sigh...
>
> > any help with 0.9.6.0 is appreciated though :)
>
> If you copy the nose plugin module from 0.9.6.1 into your project, and
> add the entry point to your setup.py for it, you can use the plugin
> running from your project. That is, add the line to your projects
> setup.py under [entry_points]:
>
> [nose.plugins]
> pylons = pylons.test:PylonsPlugin
>
> Change the second part to reflect your projects name, and copy the
> test.py from Pylons 0.9.6.1 into your project.
>
> Cheers,
> Ben
>
> smime.p7s
> 3KDownload
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---