Simplified consecutive calls to pathlib.Path.parent.

This commit is contained in:
Jon Dufresne 2019-11-04 00:59:34 -08:00 committed by Mariusz Felisiak
parent 126cfefce2
commit 607004f81a
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ except ImportError:
else:
closure_compiler = closure.get_jar_filename()
js_path = Path(__file__).parent.parent / 'static' / 'admin' / 'js'
js_path = Path(__file__).parents[1] / 'static' / 'admin' / 'js'
def main():

View File

@ -757,7 +757,7 @@ class PlainTextReportTests(SimpleTestCase):
exc_type, exc_value, tb = sys.exc_info()
reporter = ExceptionReporter(request, exc_type, exc_value, tb)
text = reporter.get_traceback_text()
templ_path = Path(Path(__file__).parent.parent, 'templates', 'debug', 'template_error.html')
templ_path = Path(Path(__file__).parents[1], 'templates', 'debug', 'template_error.html')
self.assertIn(
'Template error:\n'
'In template %(path)s, error at line 2\n'