1. David Jean Louis
  2. django-admin-tools
  3. Issues
Issue #51 resolved

More robust test running

Mikhail Korobov
created an issue

Tests executed via 'runtests.sh' are running against installed version of django-admin-tools and not against repo now. So it is necessary to do {{{ $ ./setup.py install }}} after each change before running tests and it is easy to forget.

I tried {{{ sys.path.insert(0, os.path.dirname(PROJECT_ROOT)) }}} hack but it doesn't work for me cleanly because of weird error from django-coverage. Tests are executed but then some weird exception is raised.

Need some investigation.

Comments (4)

  1. Tom von Schwerdtner

    I believe you want this:

    diff -r fcfdae91463f test_proj/manage.py
    --- a/test_proj/manage.py       Fri Sep 24 15:54:48 2010 +0200
    +++ b/test_proj/manage.py       Mon Sep 27 16:24:01 2010 -0400
    @@ -1,4 +1,7 @@
     #!/usr/bin/env python
    +import sys, os
    +sys.path.insert(0, os.path.abspath('%s/../../' % __file__))
    +
     from django.core.management import execute_manager
     try:
         import settings # Assumed to be in the same directory.
    

    adds the path above test_proj/manage.py to the path in the beginning, so it should precede any system-wide installation. This should be runnable from anywhere too.

  2. Log in to comment