Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

92
Vistas
Trying to activate Django signal in my test

Hey I am trying to activate a signal in my test - but I can not seem to make it work.

This is my receiver

@receiver(post_save, sender=models.Allocation, dispatch_uid="close_overdue_invoice_tasks")

So how can "activate" it so it will call the method:

def close_overdue_invoice_tasks(sender, **kwargs):
    ...

All the signals works and my guess is that you manually have to activate the signals when running the tests.

I am using Pytest by the way.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Your signal will be called when you save your model that it is attached to. In this case, calling .save() on an instance of Allocation will cause the signal to be called.

You shouldn't have to activate the signals, they should be already set up. Check where you defined your signals and make sure that they are being executed during your test run.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda