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

97
Views
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.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

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.

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!