Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

226
Views
Django, ¿cómo ver las cookies configuradas y desactivadas?

Estoy usando response.set_cookie() para configurar las cookies y response_delete_cookie() para eliminarlas.

Me gustaría ver si las cosas funcionan según lo previsto, pero no sé dónde buscar las cookies que se están configurando.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

En tus puntos de vista haz esto.

 ... request.COOKIES.get('cookie_name', None) ...

Para obtener la cookie o None .

over 4 years ago · Santiago Trujillo Report

0

Me gustaría ver si las cosas funcionan según lo previsto.

¡Suena como el momento perfecto para agregar algunas pruebas! Aquí hay algo para empezar:

 from django.test import TestCase from django import shortcuts class TestCookies(TestCase): def test_cookie_added(self): url = shortcuts.reverse('your-view') response = self.client.get(url) self.assertEqual(response.cookies.get('cookie_name'), 'expected') def test_cookie_removed(self): url = shortcuts.reverse('your-cookie-deleting-view') response = self.client.get(url) self.assertIsNone(response.cookies.get('cookie_name'))
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!