Testing an Interactive Voice Response System With Python and Pytest


Following my previous article on how to build an Interactive Voice Response (IVR) system with Twilio, Python and Django, in this follow-up tutorial I show how to write automated tests for this system.

It can be very challenging to test a system that rely heavily on a third party service such as Twilio. In this article, I show how to organize your code in a way that would isolate your business logic and make it easier to test separately. The article demonstrate useful testing patterns using Django's RequestFactory, unittest.mock, Pytest fixtures, build-in django-pytest and many more.

Source Code

The source code for this article and the previous one can be found here.

Read "Testing a Twilio Interactive Voice Response System With Python and Pytest" on the Twilio blog ≫

Building an IVR System with Django and Twilio
Building an IVR System with Django and Twilio



Similar articles