Please Do Not Use TEST_DATA MONGO_AMNESTY MODULESTORE

(It’s actually TEST_DATA_MONGO_AMNESTY_MODULESTORE, but Discourse doesn’t like such a long term in the post title for some reason.)

Please don’t create new tests in edx-platform that make use of ModuleStoreEnum.Type.mongo or TEST_DATA_MONGO_AMNESTY_MODULESTORE – these are actively being removed from the platform, per this DEPR. If you use either of these, you’re creating a test that uses a course content mechanism that will never run in production code. It’s mostly compatible with the ModuleStore that does run, which is why these tests were kept around.

If you create a ModuleStoreTestCase, the defaults will do the right thing, but people sometimes copy-paste from overrides from older tests that were granted amnesty during the initial transition phase. All those old tests are being reviewed right now, and are being converted. Please don’t add new ones!

Thousands of lines of tests have already been converted (like in this PR). Hopefully this transition period will be over by the end of the year, and then there won’t be any bad examples to copy-paste from.

Thank you.

1 Like