+1 -1 +8
Vote on this proposal

Django Testing: As easy as 1,2,3

by Gaurav Dadhania (speaking)

Section
Web Development
Technical level
Intermediate

Objective

Django testing is easy, there's official docs for it that you can skim through in a couple of hours and start using within a day. But what happens as your project grows? What testing patterns stand the test of time? Which libraries should you use to help you test faster and better? Can you handle the embarrassment of having a production "fail whale"? Does git blame keep you up at night?

THEN THIS TALK IS FOR YOU!

Let's look at a few tools, some proven testing strategies and have a small discussion about our battle wounds, so we emerge stronger and our builds, greener!

Description

Let's get the ball rolling by summarizing Django test docs including:

  • Using the Django test client

  • Test runners and which one to use (if not the default?!)

  • Fixtures and why they suck!

Then we'll look at 3 libraries that will make you a testing superhero(ine)!:

  • Behave

  • BDD and specs as tests

  • powered by Selenium (look at VMs, BrowserStack and PhantomJS)

  • FactoryBoy

  • What it is and how it works

  • Why is it better than using fixtures

  • Mock

  • Why mocking is a good idea (aka "build shouldn't be red cause there's no internet")

  • libraries built on mock like dropbox/responses and examples of using mock to test functions with side-effects

We'll end the session with a short Q&A about testing and loud, thunderous applause.

Speaker bio

Gaurav is a code connoisseur at CommonCode, where he works with clients like Kogan Australia and CottonOn. He thinks he's fluent in Python and JavaScript. In the past, he has been lucky enough to talk at PyCon Australia and multiple MelbDjango meetups. He likes GIFs.

He's not sure whether he should be writing this in the third-person.