These are chat archives for django/django
I have these
class ComponentTest(TestCase): fixtures = ['data.json'] @classmethod def setUpTestData(cls): # ... class Component1Test(ComponentTest): # ... class Component2Test(ComponentTest): # ...
When running test, fixture load and
setUpTestData is run multiple times, both for
Component2Test separately. Is there any way I could make it run just once?
@bignose:matrix.orgkpagcha (Gitter): the unittest model is designed to build a test suite of independent test cases. That is, the set up tends to be done each time a test case starts.
@bignose:matrix.orgkpagcha (Gitter): If you want a bunch of setup that persists between test cases, they're not really independent and you won't be testing whether things work correctly in isolation.
@bignose:matrix.orgkpagcha (Gitter): Maybe you don't want unit tests?