On Jan 29, 2008 4:27 AM, rock <[EMAIL PROTECTED]> wrote:
>
> I'm using the unittesting-environment for test-driven-development in
> Django. It works excellent, but one matter is puzzling. The Django
> documentation tells me this:
>
> "The test database
> Tests that require a database (namely, model tests) will not use your
> "real" (production) database. A separate, blank database is created
> for the tests."
...
> When I print the usernames of these users, they are "testuser" and
> "testuser2". I expect one of two explanations; either I am doing
> something strange, or the Django-documentation for "Testing Django
> Applications" is not correct.

This is a slightly misleading statement in the test documentation.
'Blank' is perhaps not the best word here. At the start of each test,
t0he database is returned to the initial state - that is, the state it
was in just after syncdb was called. This means that the only data in
the database will be the data defined in an initial_data fixture. In
your case, this means you have a testuser and testuser2 in an
initial_data fixture somewhere in your project.

This is mentioned in the testing docs, but not in the section you
refer to. This could definitely be improved.  Feel free to open a
ticket for this issue.

Yours,
Russ Magee %-)


Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to