Slide 17
Slide 17 text
TIP: UNIQUE IDS WITH DJANGO MIXER
▸ Our Django codebase has hundreds of tests
▸ Most tests create Product fixtures via
"mixer.blend('products.Product')"
▸ We use an in-memory SQLite3 DB, so each test-case has it's own
empty database
▸ PROBLEM: Elasticsearch does not have an in-memory mode, so test
fixtures pollute the DB and bleed into other tests
▸ PROBLEM: When running in parallel, up to four tests will
simultaneously try to create Product fixtures and they all try to use
ID=1, but only one such ID can exist in Elasticsearch at a time