we are running Pylons 0.9.6rc2, nose 0.9.2 (because it seemed to be
the only version we could get pylons 0.9.6rc2 working with),SqlAlchemy
0.3.8

After upgrading our Pylons app, the app works but nosetests bombs on
any call that involves our models.  We thought we had to put the
following in our __init__ in the model directory

from pylons.database import create_engine
from elixir import metadata, objectstore, options_defaults
from paste.deploy import appconfig

engine = create_engine()
session_context = objectstore.context
metadata.connect(engine)

#  create the classes for the model
options_defaults['shortnames'] = True

from modelfile import *


we also have this in our websetup.py, i'm not sure when the
websetup.py stuff gets called honestly

 conf = appconfig('config:' + filename)
 load_environment(conf.global_conf, conf.local_conf)

 engine = create_engine()
 session_context = objectstore.context
 metadata.connect(engine)

 uri = conf['sqlalchemy.dburi']

 metadata.create_all()

again the app works but nosetests fails with the following stacktrace

  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/Paste-1.4-py2.5.egg/paste/util/
import_string.py", line 67, in import_module
    mod = __import__(s)
  File "/Users/myname/dev/company/demos/acomp/acomp/websetup.py", line
10, in <module>
    import aegon.model as model
  File "/Users/myname/dev/company/demos/acomp/acomp/model/
__init__.py", line 8, in <module>
    engine = create_engine()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/Pylons-0.9.6rc2-py2.5.egg/pylons/database.py",
line 80, in create_engine
    assert uri
AssertionError


I have put the following in setup.cfg per the pylons documentation
warning on models and nosetests
[nosetests]
verbose=True
verbosity=2
where=./acomp/tests/
detailed-errors=1
with-doctest=False

any ideas?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to