Testing in Django (browser-based testing too)

HubSpot 25 First Street 2nd Floor Cambridge, MA

Cool code is tested code. Many developers know that they ought to write tests for their Django applications but don't know how to get started. Luckily, it's easy to learn and doesn't take much time. This talk will be an introduction to testing in Django and cover a few of the tools available to developers.

For testing the smallest bits of your app, you can't beat Python's own unittest. We'll cover a model and view with unittests, and explore techniques to make your tests run fast and fail meaningfully. Then we'll build the app out a little further with test-driven development.

We also need to test the end-to-end functionality of our applications. We'll look at django-webtest for fast testing the full WSGI stack, and Selenium for testing our applications in real life browsers.

Finally, your tests are no good if they're not running. Jenkins is a continuous deployment solution that will deploy and test your code at set intervals and let you know if anything broke. We'll wire up our repository, watch a successful test run, and head to the bar to celebrate the launch of our bulletproof app.