Performance: TestCase and SimpleTestCase
MEDIUM IMPACT
This concept affects test execution speed and resource usage during development, impacting developer feedback loop time.
from django.test import SimpleTestCase class MyTests(SimpleTestCase): def test_simple(self): self.assertEqual(1 + 1, 2)
from django.test import TestCase class MyTests(TestCase): def test_simple(self): self.assertEqual(1 + 1, 2)
| Pattern | Database Setup | Test Speed | Isolation | Verdict |
|---|---|---|---|---|
| TestCase | Creates test DB and rolls back | Slower due to DB setup | High isolation | [!] OK |
| SimpleTestCase | No DB setup | Faster tests | No DB isolation | [OK] Good |