I think you should be clearing out the modulestore global dict with `_MODULESTORES.clear()`. Additionally I think you will need to clear out the contentstore global dict with  `_CONTENTSTORE.clear()`.