def testUserInactiveRedirect(self): self.req = self.factory.get("/signatures/list/") self.req.user = self.user self.req.user.mark_inactive() response = views.signatures_listing(self.req) self.assertEqual(response.status_code, 302) self.assertTrue("/login/?next=/signatures/list/" in response["Location"]) self.req.user.mark_active() response = views.signatures_listing(self.req) self.assertEqual(response.status_code, 200)
def testSignaturesjtList(self): self.req = self.factory.post("/signatures/list/jtlist/", {}, HTTP_X_REQUESTED_WITH="XMLHttpRequest") self.req.user = self.user response = views.signatures_listing(self.req, "jtlist") self.assertEqual(response.status_code, 200)
def testSignaturesList(self): self.req = self.factory.get("/signatures/list/") self.req.user = self.user response = views.signatures_listing(self.req) self.assertEqual(response.status_code, 200) self.assertTrue("#signature_listing" in response.content)