At the time I asked the question I just had the sense that I wanted to debug an issue by bringing up the web interface midway through my test. I attempted to do things like stop midway through the test via set_trace() and then ctrl-c, then look at the db from a runserver run that was pointing to the test database, but I find that the test database is empty, as if the data has not yet been written out to it by the test.
Perhaps if I call dumpdata from the call_command as you suggest, that will get around this. Maybe I don't even need this. It just seemed nice to be able to debug a test from the web interface, but in reality, now that I am off and running writing tests, I guess I haven't ended up needing it after all ... In any case, thanks for your response. Margie On Jun 4, 5:47 am, Karen Tracey <kmtra...@gmail.com> wrote: > On Thu, Jun 2, 2011 at 10:04 AM, Margie Roginski > <margierogin...@yahoo.com>wrote: > > > Karen Tracy, if you are reading this, could you comment? > > > As the person that seems to be most knowledgable about django testing > > (your Django 1.1 Testing book is fantastic - I highly recommend it!), > > can you confirm that something like this is the best way to go? It > > seems strange to me that there is no more standard way of dumping the > > database from inside a test so that the state can be replicated for > > use in a runserver environment. > > Well, usually you want to go the other way: ensure your test run replicates > your real running environment. I'm a little unclear on why you want to save > the DB state from during a test? > > Probably easier than using serialize directly, particularly if you want the > whole DB, would be to call the dumpdata command via > call_command:https://docs.djangoproject.com/en/1.3/ref/django-admin/#running-manag... > > Karen > --http://tracey.org/kmt/ -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.