lundi 3 décembre 2018

Django Rest Framework: what is the approach to test calls to external API?

I have API that sends SMS to user. I use external API to handle it. The SMS API provider provides different authentication parameter for the use of testing.

What is the usual approach for this testing case?

My thought was to change the django setting in test runtime, but it's immutatble Changing Django settings at runtime

another thought is adding a condition in the views, perhaps a test POST parameter to change the authentication parameter, but will this cause a trouble and a possible uncovered code?

Aucun commentaire:

Enregistrer un commentaire