Hi all,
I'm sorry to insist like this but, I'd like to know if I'm the only
one unable to nosetest the models with sqlalchemy.
(In this case, it my fault, not a bug)
second question, is TestGears really deprecated ? (because as it was
already said on this ML, in this case, the default test is really
misleading)
Nicolas
On 29 jan, 07:56, "potens" <[EMAIL PROTECTED]> wrote:
(...)
>
> when I run this test :
>
> from turbogears import testutil, database
> from facturator.model import User
>
> database.set_db_uri("sqlite:///:memory:")
>
> class TestUser(testutil.DBTest):
> def get_model(self):
> return User
>
> def test_creation(self):
> "Object creation should set the name"
> obj = User(user_name = "creosote",
> email_address = "[EMAIL PROTECTED]",
> display_name = "Mr Creosote",
> password = "Wafer-thin Mint")
> assert obj.display_name == "Mr Creosote"
>
> I get :
>
> Traceback (most recent call last):
> File "/usr/lib64/python2.4/site-packages/TurboGears-1.0.1-py2.4.egg/
> turbogears/testutil.py", line 164, in setUp
> sqlobject.SQLObject) and item != sqlobject.SQLObject \
> TypeError: issubclass() arg 1 must be a class
>
> I saw that it's a well known bug, and Jorge Vargas said here ( http://
> groups.google.com/group/turbogears/browse_thread/thread/
> 9551c671694c02a6/b075daef067232af?lnk=gst&q=sqlalchemy
> +nose&rnum=7#b075daef067232af)
> TestGears is deprecated.
>
> Okay, I've tried without it, and I get :
> (...)
> File "/usr/lib64/python2.4/site-packages/TurboGears-1.0.1-py2.4.egg/
> turbogears/database.py", line 39, in get_engine
> dburi = alch_args.pop('dburi')
> KeyError: 'pop(): dictionary is empty'
>
> If I look to the conf, before the test, I've :
> [('autoreload.on', False), ('sqlobject.dburi', 'sqlite:///:memory:'),
> ('server.thread_pool', 10), ('server.socket_queue_size', 5),
> ('server.log_file', ''), ('server.socket_port', 8080),
> ('tg.new_style_logging', True), ('server.log_tracebacks', True),
> ('server.reverse_dns', False), ('cherrypy_started', True),
> ('server.socket_host', ''), ('server.protocol_version', 'HTTP/1.0'),
> ('server.environment', 'development'), ('server.log_to_screen', True),
> ('server.socket_file', '')]
>
> Huhu ?!? Where is the sqlalchemy conf ?
>
> If someone can post a simple (working) test_model with sqlalchemy, it
> would be greatly appreciated.
>
> I'm sorry for the length and I hope it wasn't (already) answered
>
> Nicolas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---