Blog

The Digital Agency for International Development

Entries tagged "django"

Django Haystack Lessons

We've been using Django Haystack to provide search in our Django projects for a while now, and we've had some hard won wisdom we thought we should share with the world.

By Hamish Downer on 11 June 2014

Unit Testing Django with Haystack and Solr

Django together with Haystack adds a powerful free-text search capability to your applications, and is widely used. This article explains how to write safe, reliable, repeatable tests for the search features, and avoid a common gotcha with indexing objects that shouldn't be indexed.

By Chris Wilson on 14 August 2013

Temporary monkey patches in Python tests

Did some refactoring on the Intranet Binder monkeypatch library to enable temporary patches using Python's context objects. This is particularly nice for use in unit tests, where you might need to mock or stub out a component's dependencies, but you don't want those changes to be visible after your test finishes, or you only want them active for part of the test.

By Chris Wilson on 30 January 2013

Making it obvious which copy of a Django site you are using

We frequently have multiple copies of a site running - the production server, the staging server and the local development copy.  You want to be sure you are editing the correct site, and haven't switched sites by mistake. This post shows some methods to make it obvious which copy you are looking at.

By Hamish Downer on 22 January 2013

New features in enhanced Django TestCase

For about a year I've been working on our Django Binder app. It was originally designed for use in intranet applications, but much of the code is useful in Django apps of all kinds.

I've just committed a bunch of improvements from my work on the iSchool project, which I'd like to highlight to anyone interested, partly as internal documentation.

By Chris Wilson on 09 January 2013