Thanks for the test!  It would be better not to cause the directory / file to be created inside the software:  could you re-work to use 'tempfile.mkdtemp'?  Something like:

    def test_custom_tempdir_create_file(self):
        import shutil
        import tempfile
        dm = self.dm
        cwd = os.getcwd()
        test_tempdir = tempfile.mkdtemp()
        try:
            newfile = dm.create_file("tst", "w", test_tempdir)
            # ... the rest of your testcase
        finally:
            shutil.rmtree(test_tempdir)