

Testing an Interactive Voice Response System With Python and Pytest
source link: https://hakibenita.com/python-django-pytest-twilio-ivr
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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.

Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK