On 8/14/07, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
>
> I'm proposing a "--with-fixture" flag to django-admin.py, so that you
> could do something like this:
>
>     django-admin.py runserver --with-fixture=mydata.json

+1 to the general idea.

However, this syntax (--with-fixture) doesn't really lend itself well
to having multiple fixtures. When you specify fixtures for test, you
specify a list, not a single fixture. My test harnesses generally
consist of a number of smaller fixtures, rather than one big fixture
that is used for all tests.

I would suggest that rather than trying to make the --with-fixture
flag handle all this, it would be better to do this as a top level
command, i.e.:

django-admin.py testserver mydata.json accounts.json categories.json

This would also draw attention to the fact that the database that will
be used for the server and the data in that database are a testing
facility, not the main server and main database.

> * Delete the test database when the development server is stopped.

As noted by others, I don't think this is wise. Todd's suggestion of
clearing the database at the start of execution strikes me as a better
approach.

> In the future, the next step would be to keep track of any database
> changes and optionally serialize them back into the fixture when the
> server is stopped.

Cool, yes - but but also very difficult. Again, multiple fixtures are
the problem here.

Yours,
Russ Magee

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" 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/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to