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!
# This checks to see if django tests are running (i.e. manage.py test)
if argv and 1 < len(argv):
IS_TEST = 'test' == argv[1]
else:
IS_TEST = False
if IS_TEST:
DB_ENGINE = 'django.db.backends.sqlite3'
else:
DB_ENGINE = 'django.db.backends.oracle'
DATABASES = {
'default': {
'ENGINE': DB_ENGINE, # Add 'postgresql_psycopg2',
'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'db_name', # Or path to database
file if using sqlite3.
'USER': 'spin_log_user', # Not used with
sqlite3.
'PASSWORD': 'XXXXX', # Not used with sqlite3.
'HOST' : '',
'PORT' : '',
}
}
On Oct 4, 3:00 pm, Ian <[email protected]> wrote:
> On Oct 4, 10:30 am, msbuck <[email protected]> wrote:
>
> > Good news! Yesterday, I was repeatedly starting the development server
> > from Eclipse which is on the Run As -> menu which cascades to Run
> > Server or Run Python Unit Test. I must have accidently clicked that we
> > I really wanted to start my server. That command runs the PyDev Test
> > runner and that's what clears out my tables. Now I just have to figure
> > out how to disable the option in Eclipse or get it to do nothing. Any
> > suggestions in this area would be appreciated and thanks to all for
> > the suggestions.
>
> What does your DATABASES setting look like? Everything test-related
> is supposed to be run under a separate schema and tablespace to avoid
> modifying actual data. It sounds like something is running in the
> wrong place.
--
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.