3 ms·
I use Django test fixtures in one way! I have a series of E2E tests with Splinter [0] that go through setting up a variety of things from scratch and testing c
by michaelpb 6y ago
I use Django test fixtures in one way!
I have a series of E2E tests with Splinter [0] that go through setting up a variety of things from scratch and testing core features. Instead of having really long, complicated test that goes through the steps, I instead wrote a little helper function that "freezes" the DB after each step as a JSON fixture (which is then loaded by the next test), to allow me to break it down into many smaller tests that "start" from various reasonable database states. Works pretty well!
I don't use them however for unit tests or any non-E2E tests. I just use helper factory functions with hardcoded test data.
[0] https://splinter.readthedocs.io/en/latest/ https://splinter.readthedocs.io/en/latest/