My Python version is 2.6.
I would like to execute the test setUp method only once since I do things there which are needed for all tests.
My idea was to crea
If you ended up here because of need to load some data for testing... then as far as you are using Django 1.9+ please go for setUpTestData:
class MyTests(TestCase):
@classmethod
def setUpTestData(cls):
# Set up data for the whole TestCase
cls.foo = Foo.objects.create(bar="Test")
def test1(self):
self.assertEqual(self.foo.bar, 'Test')