Re: Creating data in TestCase.setUpClass() (proposed refactoring)

2014-11-12 Thread Thomas Chaumeny
Thanks for your feedback. I updated my pull request (https://github.com/django/django/pull/3464) following Anssi suggestion: subclasses of TestCase can define a class method "setupTestData" to create some data once for the whole TestCase. If the database backend does not support transaction (e.

Re: Creating data in TestCase.setUpClass() (proposed refactoring)

2014-11-10 Thread Josh Smeaton
Just a quick FYI - https://groups.google.com/forum/#!msg/django-developers/N0HEAD1ht8k/GQJ77RLUydsJ I tried to implement fixture loading in setupClass() and ran into a few difficulties. I did a lot of profiling though. You get about a factor of 3 speedup for tests that use fixtures. It only re

Re: Creating data in TestCase.setUpClass() (proposed refactoring)

2014-11-09 Thread Anssi Kääriäinen
On Sun, 2014-11-09 at 16:19 -0800, Thomas wrote: > In order to make the whole Django test suite pass with that change, I > had to adapt a bunch of tests. I described the technical issues in > https://code.djangoproject.com/ticket/20392#comment:22 but the main > problem is due to some tests in Djan

Creating data in TestCase.setUpClass() (proposed refactoring)

2014-11-09 Thread Thomas
Hi! I'm opening this topic to discuss some TestCase refactoring I have been working on, as it might have a non-negligible impact. The basic idea — which is not mine, see #20392 and that related discussion https://groups.google.com/forum/#!topic/django-developers/N0HEAD1ht8k — is to allow the c