Hi,

I just started my first experimets wit running django tests and
encountered several issues.

One of the issues is related to south.

If I want to run  single short tests. then I spend more time creating
the database than I need to run the tests.

The database creation time is especially high if the project contains
already many south database migrations.

As for testing the database is created from scratch and as migrations
are not really needed in this case I decided to disable south for
running tests.

The oway, that I came up with is following.

in settings.py

I do:

# try to determine, whether in testing mode or
# whether in 'normal' mode

# Thanks to Mike Dewherst for pointing me to this 'trick'
# of how one could detect whether one started tests
# Depending on the exact needs, the condition could be
# tuned / adapted
if not 'test' in sys.argv[1:]:
    TESTING = True
else:
    TESTING = False

if not TESTING:
    INSTALLED_APPS +=  ( 'south', )

This is doing the job:

I just wondered whether there were alternative /  more elegant ways.









-- 
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.

Reply via email to