Have a switch that is set to OFF by default (then your tests will switch to 
using a mocked approach) and then have test that can only be be run with 
direct access to the API if you deliberately set it ON.

No "accidents".

On Tuesday, 24 July 2018 04:21:07 UTC+2, Kum wrote:
>
> Is there a way to prevent people from accidentally doing so?
>
> On Monday, July 23, 2018 at 7:39:27 AM UTC-4, Jason wrote:
>>
>> you shouldn't be accessing external services with your tests, you should 
>> mock or patch them with expected responses/failures and test based on that.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c4df2697-41ab-42ad-86cb-65b94d64f5fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to