The behavior I was seeing was as if the tests where run without using
manage.py. My app tests at this point are very simple. I use a fixture
to load data to do the view tests but don't explictly delete anything
from the tables.

I did basically what you suggested. You can set up the environment
variables that PyDev uses for unit tests and it can be different from
the regular running environment so I'm setting it to an explicit
settings.py module where sqlite3 is used.

I need to learn more about how PyDev runs it's unit tests. That will
be my next step.

Thanks for the advice.


On Oct 5, 12:09 pm, Ian Kelly <[email protected]> wrote:
> On Tue, Oct 4, 2011 at 2:28 PM, msbuck <[email protected]> wrote:
> > Below is the settings. I am fairly new to python unit testing so my
> > understanding of things could be better. But right now, if I select
> > Run As -> Python Unit Test will my project is selected, it runs all of
> > my Django tests and clobbers my working db as a result. The test
> > runner also appears to be ignoring my @skipUnless decorators that
> > should prevent db tests from running if settings.IS_TEST is set to
> > False. I'm getting frustrated again!
>
> I haven't used PyDev, but I would imagine it's probably importing the
> management commands and running them programmatically, rather than
> simply trying to run manage.py.  That would explain why your IS_TEST
> is False.  According to the docs, PyDev has a DJANGO_SETTINGS_MODULE
> variable.  I suggest setting that to an alternate settings.py that
> contains your test settings.
>
> I still can't see any reason why the tests would be flushing your
> tables, though.  Does it happen when you issue manage.py test (using
> the oracle backend) as well, or only from PyDev?  Could there be
> something in your app tests that might be causing the flush?

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

Reply via email to