On Wed, Mar 20, 2013 at 5:26 PM, Aymeric Augustin <
aymeric.augus...@polytechnique.org> wrote:

> Hello,
>
> Currently there are three locations for the tests of contrib apps:
> - under tests/ — eg. admin
> - inside the app — eg. auth
> - both — eg. contenttypes
>
> Following the modeltests / regressiontests merge, I propose to move all
> contrib app tests under tests/. This has de following advantages:
> - it makes them easier to discover and prevents accidental duplication
> - they won't be run by './manage.py test'
> - it'll dam up the stream of "if I change setting X then test Y in contrib
> app Z fails"
>
> I'm aware of the idea that contrib apps could include integration tests to
> validate that they're properly used within projects, but I don't believe we
> have any such tests currently.
>
> What do you think?
>

Personally, I'd rather see the opposite -- contrib apps containing their
own tests, and the tests directory containing just the tests for Django
itself. That enforces the fact that the apps really are self contained
apps, and can be tested independently.

The catch -- and the reason why the tests are broken up the way they are --
is that the test framework isn't currently rich enough to support this.
Admin is the best example of this -- in order to test admin, you need
different test models in different test apps, and the current test
framework doesn't support this very well.

This really points at a deficiency in Django's testing tools that really
should be addressed. It's something I've wanted to look at for a while, but
I've never got around to it. It's also something that's likely to be easier
when the app refactor lands, because a lot of the problem lies in the app
cache.

The point about not running the tests under ./manage.py test is a slightly
moot point if we move to the unittest2 discovery mechanism -- last time I
looked at that patch, unittest2 discovery would mean that contrib tests
wouldn't be run (by default) in a project anyway.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to