Exemplo n.º 1
0
 def testUserInactiveRedirect(self):
     self.req.user.mark_inactive()
     response = views.dashboard(self.req)
     self.assertEqual(response.status_code, 302)
     self.assertTrue("/login/?next=/dashboard/" in response['Location'])
     self.req.user.mark_active()
     response = views.dashboard(self.req)
     self.assertEqual(response.status_code, 200)
Exemplo n.º 2
0
 def testUserInactiveRedirect(self):
     self.req.user.mark_inactive()
     response = views.dashboard(self.req)
     self.assertEqual(response.status_code, 302)
     self.assertTrue("/login/?next=/dashboard/" in response['Location'])
     self.req.user.mark_active()
     response = views.dashboard(self.req)
     self.assertEqual(response.status_code, 200)
Exemplo n.º 3
0
 def testTopBar(self):
     response = views.dashboard(self.req)
     self.assertTrue(">{0} {1}</a>".format(self.user.first_name,
                                           self.user.last_name)
                     in response.content)
     self.assertTrue("&nbsp;({0})".format(self.user.role)
                     in response.content)
Exemplo n.º 4
0
 def testTopBar(self):
     response = views.dashboard(self.req)
     self.assertTrue(">{0} {1}</a>".format(
         self.user.first_name, self.user.last_name) in response.content)
     self.assertTrue(
         "&nbsp;({0})".format(self.user.role) in response.content)