The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

unit_testing a python API

Occasional Contributor

unit_testing a python API

I've written an API using python and would like to add unit tests to the code which I've written.


The only way to fully test the functionality would be to CRUD the data to your server.  I'm loathe to use a client's live dataset, so is there a testbed account to which data can be sent/received when tests are running?   My proposal would involving sending tens (rather than hundreds) of requests per test and naturally it'd be ok for there to be a data throttle in place, say a total of 500 calls per day.   Any emails sent would be to dummy email addresses only.


Could such a test-bed account be made available? 


Re: unit_testing a python API

Hi Gabrielle,


Unfortunately we do not have any testbed or sandbox accounts available for developers to test against. However, you can at any time sign up for a trial account, populate it with data, get an access token for that account, and then perform your testing. 


Please let me know if this is helpful, or if you have any questions. See API Keys topic for more information on how to get an Oauth access token using your API key. 

Rich Marcucella
Sr. Technical Writer, Content Developer
Web Services Team
Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More