(self, response, csrf_secret=None)
| 322 | |
| 323 | # This method depends on _unmask_cipher_token() being correct. |
| 324 | def _check_token_present(self, response, csrf_secret=None): |
| 325 | if csrf_secret is None: |
| 326 | csrf_secret = TEST_SECRET |
| 327 | text = str(response.content, response.charset) |
| 328 | match = re.search('name="csrfmiddlewaretoken" value="(.*?)"', text) |
| 329 | self.assertTrue( |
| 330 | match, |
| 331 | f"Could not find a csrfmiddlewaretoken value in: {text}", |
| 332 | ) |
| 333 | csrf_token = match[1] |
| 334 | self.assertMaskedSecretCorrect(csrf_token, csrf_secret) |
| 335 | |
| 336 | def test_process_response_get_token_not_used(self): |
| 337 | """ |
no test coverage detected