'Helper method to assert that a given url will return a 404 status code'

def _assert_404(self, url, use_post=False):

    if use_post:
        response = self.client.post(url)
    else:
        response = self.client.get(url)
    self.assertEquals(response.status_code, 404)
