Removed redundant os.chdir() in RunInTmpDirMixin child classes.

setUp() already calls os.chdir(self.test_dir).
This commit is contained in:
Jon Dufresne 2019-02-05 08:00:04 -08:00 committed by Tim Graham
parent 1e280f031e
commit 4d425abc84
1 changed files with 0 additions and 2 deletions

View File

@ -37,7 +37,6 @@ class ExtractorTests(POFileAssertionMixin, RunInTmpDirMixin, SimpleTestCase):
PO_FILE = 'locale/%s/LC_MESSAGES/django.po' % LOCALE PO_FILE = 'locale/%s/LC_MESSAGES/django.po' % LOCALE
def _run_makemessages(self, **options): def _run_makemessages(self, **options):
os.chdir(self.test_dir)
out = StringIO() out = StringIO()
management.call_command('makemessages', locale=[LOCALE], verbosity=2, stdout=out, **options) management.call_command('makemessages', locale=[LOCALE], verbosity=2, stdout=out, **options)
output = out.getvalue() output = out.getvalue()
@ -500,7 +499,6 @@ class SymlinkExtractorTests(ExtractorTests):
os.symlink(os.path.join(self.test_dir, 'templates'), self.symlinked_dir) os.symlink(os.path.join(self.test_dir, 'templates'), self.symlinked_dir)
else: else:
self.skipTest("os.symlink() not available on this OS + Python version combination.") self.skipTest("os.symlink() not available on this OS + Python version combination.")
os.chdir(self.test_dir)
management.call_command('makemessages', locale=[LOCALE], verbosity=0, symlinks=True) management.call_command('makemessages', locale=[LOCALE], verbosity=0, symlinks=True)
self.assertTrue(os.path.exists(self.PO_FILE)) self.assertTrue(os.path.exists(self.PO_FILE))
with open(self.PO_FILE) as fp: with open(self.PO_FILE) as fp: