Re: tests in separate project directory

2007-05-02 Thread Russell Keith-Magee

On 5/2/07, SanPy <[EMAIL PROTECTED]> wrote:
>
> I have some unit tests that are not directly app / model related. I
> want to put those tests in a separate directory in my svn trunk (e.g.
> myprojects/project1/trunk/project, myprojects/project1/trunk/tests).
> How can I make these tests run through the django test runner (i.e.
> when executing 'python manage.py test')?

The hacky way would be to pick an app that doesn't have any tests,
define a tests.py module, and put 'from mytests import *' in it. This
will get picked up by the existing test framework.

A better way is to overwrite the test runner. Duplicate
django.test.simple, but add in logic to search your external test
directory. Then point settings.TEST_RUNNER at your new run_tests
method, and `./manage.py test` will use your new test execution
strategy.

Yet another way is to write your own test executing script that uses
the existing test runner. The django.test.simple.run_tests method
(which is what ./manage.py calls by default) allows you to pass an
'extra_tests' argument - these tests are integrated into the overall
suite. If you write your own test script (rather than using
./manage.py test), you can call django.test.simple.run_tests with your
external test suite as an 'extra' test.

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



tests in separate project directory

2007-05-02 Thread SanPy

I have some unit tests that are not directly app / model related. I
want to put those tests in a separate directory in my svn trunk (e.g.
myprojects/project1/trunk/project, myprojects/project1/trunk/tests).
How can I make these tests run through the django test runner (i.e.
when executing 'python manage.py test')?


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