Include setUpTestData as a way to speed up tests
In Adam Johnson's book "Speed up your Django Tests", there's a section on using setUpTestData to speed up tests. Since we have a section on speeding up tests already, I think we should add this tip to it. We also mention in docs/topics/testing/tools.txt, that setUpTestData is faster than using setUp.
Change History
(8)
| Triage Stage: |
Unreviewed → Accepted
|
| Owner: |
set to Tim Schilling
|
| Status: |
new → assigned
|
| Patch needs improvement: |
set
|
| Patch needs improvement: |
unset
|
| Triage Stage: |
Accepted → Ready for checkin
|
| Resolution: |
→ fixed
|
| Status: |
assigned → closed
|
Sounds good. I also think the
AnimalTestCaseexample at the top of that page should be updated. It's a little debatable, since part of the point of that section is to demonstrate thatTestCaseis a lightweight subclass ofunittest.TestCase, and we'd be immediately showing a custom method, but we should be able to clarify that with some appropriate wording.