The next stage: writing a book
I've decided to try and develop this tutorial into an actual book on test-driven development for web apps. Have a look at the chapter outline I've posted as part 6:...
View Article"TDD / Django tutorial: The Book!"
[update April 2012] : The book is now coming out on O'Reilly! more info here: http://www.tdd-django-tutorial.com/blog/articles/2013/test-driven-development-web-applications-book-exis/ Thanks so much...
View Article"Test Driven Development of Web Applications" -- the book exists, and is...
I can't quite believe this is actually happening, but I have not only signed a contract with O'Reilly, but i have actually written the first four chapters, or at least a first draft of the first four...
View ArticleDay against DRM and this book's copyright
Hooray for O'Reilly, who are giving away ebooks half-price in celebration of the FSF's "Day against DRM"! When I was first speaking to publishers about this book, I was a bit nervous. I'm very intersed...
View ArticleA lovely review! "like sitting down to pair-program with the author"
Jason, whom I met at PyCon this year, wrote a lovely review of my book on the O'Reily site. I'm very grateful because I think he actually helped me to see some things I didn't realise myself about the...
View ArticleWhat to say about deployment?
My book has got to the stage of a minimum viable site. I want the next chapter to be about actually deploying the site, even though it's ridiculously early -- to encourage the habit of "deploy early,...
View ArticleUsing the built-in views and forms for new user registration in Django
Have been digging into the built-in forms and views from django.contrib.auth. I always knew you could get generic views for login, logout, even password reset, but I didn't know you could actually...
View ArticleHow to unit test tornado ioloop callbacks
WARNING: this is not battle-tested wisdom of a massively experienced tornado tester. Today was the first time we ever tried to test something that actually uses the ioloop, and we've probably got it...
View ArticleTDD videos from EuroPython 2013, mine and others
I can't believe the videos are already up! Here's a few links: My usual TDD/Django Tutorial now featuring the example from the book! People's favourite bit seemed to be when I stand on the chair... Me...
View ArticleFast tests are useless, hot lava be damned
tl;dr: I think there's a real danger that striving for an ultrafast test suite, will lead you to overly mocky, disjointed tests which don't help you catch bugs and don't help you code well. At this...
View ArticleUnit testing fabric scripts for deployment
In chapter 8 of my book I introduce a fabric script as a way of automating the deployment of our example app. You can see the section where I do so here. After 7 chapters of building everything...
View ArticleTesting Django Class-Based (Generic) Views
This blog post is a first rough draft of a planned appendix to my book. It follows on from Chapter 9, which is all about forms and validation. You can take a look at it here If you want to check out...
View ArticleUnit testing Ajax calls: if you're not using a mocking library, it's a world...
tl;dr: I found myself going through increasing contortions trying to TDD some JavaScript code with Ajax in. Once I started using sinon.js, all the pain went away. Folks, don’t try to roll your own...
View ArticleHow to log exceptions to stderr in Django
Here's a common set of questions about Django: How do I get django to log errors to stderr? Why can't I see Django exceptions in the console? How do I get Django to log exceptions? How to print debug...
View ArticleBook upgraded to Django 1.7!
In a (futile) attempt to future-proof the book, I decided to upgrade it to Django 1.7. Here's how that went down. Overview Unsurprisingly, the biggest change was to do with migrations. Like any new...
View ArticleKent Beck on the limits of TDD
For anyone that's been following the DHH / #isTDDDead controversy, or for anyone interested in what the limits of TDD are. Kent Beck (the godfather) had some really good reflections on what he was...
View ArticleThe print book is available!
My copy of the print edition arrived in the post! I am my own customer... (OK that actually happened last month. This post is a little late. I was distracted by Oscons and stuff!) Anyway, that's it,...
View ArticleHow to get Selenium to wait for page load after a click
Oft-heard is the folorn cry... Every so often you get bitten by a weird behaviour in one of your Selenium tests. You tell it to click a link, and then you ask it something about the new page, and it...
View ArticleTest-Driving a docker-based Postgres service using py.test
[Cross-posted on the PythonAnywhere blog] We've been working on incorporating a Postgres database service into PythonAnywhere, and we decided to make it into a bit of a standalone project. The shiny is...
View ArticleDecorators!
Someone recently wrote to me asking about decorators, and saying they found them a bit confusing. Here's a post based on the email I replied to them with. The best way to understand decorators is to...
View Article