Confused about databases

3 views
Skip to first unread message

andrew cooke

unread,
Sep 20, 2010, 5:59:22 PM9/20/10
to Django: sane testing

Hi,

I am a little new to some of this, so I am not sure if I am doing
something wrong, or if there's something missing from your library,
but when I run a Selenium test that uses the Django authentication
middleware I get an error indicating that the appropriate tables are
missing from the database.

Now I know that I needed to run syncdb when first installing all
this. I assumed that for the test databases you would automatically
do the equivalent. Is that not correct? (This is the first time I
have run a test that actually reads the database). Maybe I need to
explicitly do something? If so, what?

Thanks,
Andrew

PS I am using the branch I checked out the other day. I have not
updated it or altered in any way.

andrew cooke

unread,
Sep 20, 2010, 6:09:57 PM9/20/10
to Django: sane testing
Adding
fixtures = ['initial_data']
to the test case didn't seem to change anything. And I can't see any
log output suggesting fixtures are being applied. This is with
multiple databases, as discussed earlier.

Andrew

andrew cooke

unread,
Sep 20, 2010, 6:19:54 PM9/20/10
to Django: sane testing

I set verbosity=2 in DjangoPlugin.startTest and now do get some
output. It appears to be trying to load fixtures but not finding
any. I need to go eat, but will continue looking at this later.

Cheers,
Andrew

andrew cooke

unread,
Sep 20, 2010, 6:49:16 PM9/20/10
to Django: sane testing

It's not fixtures, it's the models which are not being mapped. I
guess maybe the idea is that I do that myself - dump the database
generated by syncdb to a fixture and apply that. Makes sense. Sorry
if this is just noise. Anyway, really need to go eat now..

Andrew

Almad

unread,
Sep 21, 2010, 4:55:50 PM9/21/10
to django-sa...@googlegroups.com, andrew cooke
Hi,

honestly, I'm a bit confused - if You could send some code snippets here (or
to bugs at almad.net, if You don't want to post them to google), I might be
able to look into it closer :)

Almad

andrew cooke

unread,
Sep 21, 2010, 5:16:34 PM9/21/10
to Django: sane testing
Sorry, I should have been clearer.

Everything appears to work fine. I was confused about how tests with
databases were supposed to work, but once I started using fixtures
correctly, everything works fine.

Sorry again for the confusion,
Andrew
Reply all
Reply to author
Forward
0 new messages