'Assert that the given response was a 400 with the given error code'

def _assert_error(self, response, status_code, error):

    self.assertEqual(response.status_code, status_code)
    self.assertEqual(json.loads(response.content), {'error': error})
