Exemple #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)
Exemple #2
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)
Exemple #3
0
 def testDashboard(self):
     response = views.dashboard(self.req)
     self.assertEqual(response.status_code, 200)
     self.assertTrue("#count_listing" in response.content)
     self.assertTrue("#backdoor_listing" in response.content)
     self.assertTrue("#campaign_listing" in response.content)
     self.assertTrue("#indicator_listing" in response.content)
     self.assertTrue("#email_listing" in response.content)
     self.assertTrue("#sample_listing" in response.content)