Writing Tests that Fail Well

Writing better tests is a lifelong pursuit, apparently.

One thing I've been noticing lately, especially while doing code reviews, is that we are usually thinking about how do I know the code worked.

Great! But we are usually not thinking ahead about what am I going to do when the …

more ...


Mock configuration tip

A little tip for working with the mock library. Let's say you need to set up some child attributes, like for example you're mocking up a django.contrib.auth.User, and you want it to be a logged in user:

>>> user = mock.Mock()
>>> user.username = 'Bob'
>>> user.is_authenticated.return_value = True …
more ...