Changes between Version 5 and Version 6 of Ticket #27325, comment 5


Ignore:
Timestamp:
Mar 31, 2017, 2:34:51 AM (8 years ago)
Author:
Aleksej Manaev

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27325, comment 5

    v5 v6  
    77
    88EDIT:
    9 Now I do not get errors using WHITENOISE_USE_FINDERS=True and WHITENOISE_AUTOREFRESH=True which can be used in StaticLiveServerTestCase to achieve running tests without collectstatic first. See: tests/staticfiles_tests/test_liverserver.StaticLiveServerViewUseFinders.test_collectstatic_emulation
    10 Does anybody know why WHITENOISE_USE_FINDERS is ignored in WhiteNoiseMiddleware?
    11 See: tests/staticfiles_tests/test_liverserver.TestWhitenoiseMiddleware.test_collectstatic_emulation
     9Now I do not get errors using WHITENOISE_USE_FINDERS=True and WHITENOISE_AUTOREFRESH=True which can be used in StaticLiveServerTestCase to achieve running tests without collectstatic first.
     10See: tests/staticfiles_tests/test_liverserver.StaticLiveServerViewUseFinders.test_collectstatic_emulation
     11See: tests/staticfiles_tests/test_liverserver.TestWhitenoiseMiddlewareUseFinders.test_collectstatic_emulation
     12
     13Does anybody know why overriding_settings within a test method has no effect?
     14
     15For example:
     16
     17{{{
     18  with self.settings(WHITENOISE_USE_FINDERS=True, WHITENOISE_AUTOREFRESH=True):
     19    response = self.client.get('/static/test/file.txt')
     20    content = b''
     21    for item in response.streaming_content:
     22      content += item
     23    self.assertEqual(content.rstrip(b'\r\n'), b'In static directory.')
     24}}}
Back to Top