New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #27854 -- Added system check for nonexistent directories in STATICFILES_DIRS setting. #14056
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jacobtylerwalls Thanks 👍
84aab66
to
c9c8edd
Compare
5c6a7ee
to
37debdd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jacobtylerwalls Thanks for updates 👍
I reorganized commits, added a small cleanup with using CollectionTestCase
in FindersCheckTests
tests, and pushed minor edits.
Warning( | ||
'The directory /fake/path in the STATICFILES_DIRS setting does not exist.', | ||
id='staticfiles.W004', | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't mix a new check with existing tests. I would move it to a separate method.
@override_settings(STATICFILES_DIRS=container_for_tempdir) | ||
def test_no_errors_with_provided_directory(self): | ||
with tempfile.TemporaryDirectory() as tmpdirname: | ||
self.container_for_tempdir.append(tmpdirname) | ||
self.assertEqual(check_finders(None), []) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant with test_no_errors_with_test_settings
because CollectionTestCase
uses existing directories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, yes, no problem, super, thanks all.
|
||
class FindersCheckTests(SimpleTestCase): | ||
|
||
class FindersCheckTests(CollectionTestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using CollectionTestCase
gives us existing directories in "static" settings.
ticket-27854