def METHOD_NAME(self):
    old_home = os.environ.get('HOME')
    test_str = R'C:\Documents and Settings\тест\Application Data'
    try:
        os.environ['HOME'] = test_str
        self.assertEqual(compat_expanduser('~'), test_str)
    finally:
        os.environ['HOME'] = old_home or ''