I've got a LiveServerTestCase and I'm not sure what's going on.  I have to 
include my normal database settings for it to work.  It still writes to the 
memory test database, but all the other tests use the normal one which 
breaks things.

In LiveServerTestCase.setUpClass I put the following:

        print cls.server_thread.connections_override['default'], 
len(cls.server_thread.connections_override['default'].introspection.table_names())
        cls.server_thread.start()

        # Wait for the live server to be ready
        cls.server_thread.is_ready.wait()


And in LiveServerThread.run I put a similar print statement:

     # provided by the main thread.
     for alias, conn in self.connections_override.items():
         print 'New Thread', conn, len(conn.introspection.table_names())

Which prints out:

<django.db.backends.sqlite3.base.DatabaseWrapper object at 0x1057a4188> 122
New Thread <django.db.backends.sqlite3.base.DatabaseWrapper object at 
0x1057a4188> 0

I don't get it.  The override is there and they are the same object... but 
somehow the second time it has no tables :(  

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


Reply via email to