Changes between Initial Version and Version 2 of Ticket #32885


Ignore:
Timestamp:
Jun 27, 2021, 10:55:44 AM (3 years ago)
Author:
Chris Jerdonek
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32885 – Description

    initial v2  
    1 In `tests/csrf_tests/tests.py`, `CsrfViewMiddlewareTestMixin` is only supposed to contain logic common to both the `CSRF_USE_SESSIONS=True` and `CSRF_USE_SESSIONS=False` cases (since both `CsrfViewMiddlewareTests` and `CsrfViewMiddlewareUseSessionsTests` inherit from it). However, I noticed that it contains some logic specific to the `CSRF_USE_SESSIONS=False` case.
     1In [https://github.com/django/django/blob/e9fbd7348013bce753c0f4e0e492007f50a87095/tests/csrf_tests/tests.py tests/csrf_tests/tests.py], [https://github.com/django/django/blob/e9fbd7348013bce753c0f4e0e492007f50a87095/tests/csrf_tests/tests.py#L34 CsrfViewMiddlewareTestMixin] is only supposed to contain logic common to both the `CSRF_USE_SESSIONS=True` and `CSRF_USE_SESSIONS=False` cases (since both `CsrfViewMiddlewareTests` and `CsrfViewMiddlewareUseSessionsTests` inherit from it). However, I noticed that it contains some logic specific to the `CSRF_USE_SESSIONS=False` case.
    22
    33Specifically, `CsrfViewMiddlewareTestMixin`'s `test_process_response_get_token_not_used()`, `test_token_node_with_new_csrf_cookie()`, `test_cookie_not_reset_on_accepted_request()` all check `resp.cookies`, even though that attribute is specific to `CSRF_USE_SESSIONS=False`.
Back to Top