Thursday, June 24, 2010

test database and unittesting

When i do "Animal.object.create(name="dog")" in a unittest setup no
row is added to the database, but if i do this in the normal code it
works. The temporary test database is created, but the adding of
objects does not work.

I'm totally lost as to where the error could be. side note: i also had
a problem when importing more than one model, which would result in
the test not being found by the system. I could evade this problem by
just importing the whole models.py and then accessing the objects with
"models.Animal". But all this is now in vain, seeing that nothing is
added to the database

thanks for any tips

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate