def isOk(self, url, code=OK): res = self.client.get(url) self.failUnlessEqual(res.status_code, code) self.failIf(IF_INVALID in res.content) class IsOkTest(TestCase): def all_test(self): import settings settings.TEMPLATE_STRING_IF_INVALID = IF_INVALID for k in URLS: isOk(URLS[k]) settings.TEMPLATE_STRING_IF_INVALID = ""