Skip to content

Commit

Permalink
Add code comments for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaudcolas committed May 20, 2021
1 parent 815759f commit 99f6deb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def test_parent_template_from_variable(self):
},
])
def test_get_template_dirs_app_dirs(self):
template_dirs = ['/'.join(d.replace(os.path.dirname(settings.BASE_DIR), 'dpl').split('/')[-4:-1]) for d in get_template_dirs()]
# get_template_dirs() returns absolute paths. Convert to simpler relative paths so we can write assertions.
template_dirs = ['/'.join(str(d).replace(os.path.dirname(settings.BASE_DIR), 'dpl').split('/')[-4:-1]) for d in get_template_dirs()]
self.assertListEqual(template_dirs, [
'django/contrib/auth',
'dpl/pattern_library',
Expand All @@ -65,7 +66,8 @@ def test_get_template_dirs_app_dirs(self):
},
])
def test_get_template_dirs_list_dirs(self):
template_dirs = ['/'.join(d.replace(os.path.dirname(settings.BASE_DIR), 'dpl').split('/')[-4:-1]) for d in get_template_dirs()]
# get_template_dirs() returns absolute paths. Convert to simpler relative paths so we can write assertions.
template_dirs = ['/'.join(str(d).replace(os.path.dirname(settings.BASE_DIR), 'dpl').split('/')[-4:-1]) for d in get_template_dirs()]
self.assertListEqual(template_dirs, [
'dpl/tests/test_one',
'dpl/tests/test_two',
Expand Down

0 comments on commit 99f6deb

Please sign in to comment.