# How to Test Django Signals Like a Pro

DevFeed: [How to Test Django Signals Like a Pro](<https://devfeed.tech/articles/how-to-test-django-signals-like-a-pro-33910.md>)

Original publisher: [Read original article](<https://hakibenita.com/how-to-test-django-signals-like-a-pro>)

Author: Haki Benita

Published: 2017-02-17T22:00:00Z

Content type: tutorial

Language: en

Sources: [Haki Benita](<https://devfeed.tech/sources/haki-benita.md>)

Topics: [Django](<https://devfeed.tech/topics/django.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [modules](<https://devfeed.tech/topics/modules.md>), [context](<https://devfeed.tech/topics/context.md>)

Tags: [articles](<https://devfeed.tech/tags/articles.md>), [decoupling](<https://devfeed.tech/tags/decoupling.md>), [django](<https://devfeed.tech/tags/django.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [modules](<https://devfeed.tech/tags/modules.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

This tutorial explains how to test Django signals. It first demonstrates testing signal arguments by connecting a handler, then introduces a context manager to reduce the boilerplate involved in connecting, running, saving arguments, and disconnecting handlers.

## Source excerpt

Django signals are extremely useful for decoupling modules. They allow a low-level Django app to send events for other apps to handle without creating a direct dependency. Signals are easy to set up, but harder to test. In this article we implement a context manager for testing Django signals, step by step.