Exemple #1
0
 def test_revoke_by_non_approver(self):
     # you can't revoke if you didn't approve
     self.changeset.approvers.add(self.peon, self.queuer)
     self.login(self.approver)
     rsp = self.client.post(self.url, data={'revoke': True})
     self.assertEqual(2, self.changeset.number_of_approvals)
     assert_in_messages(rsp, "You did not approve")
     self.assertEqual(BAD_REQUEST, rsp.status_code)
Exemple #2
0
 def test_revoke_by_non_approver(self):
     # you can't revoke if you didn't approve
     self.changeset.approvers.add(self.peon, self.queuer)
     self.login(self.approver)
     rsp = self.client.post(self.url, data={'revoke': True})
     self.assertEqual(2, self.changeset.number_of_approvals)
     assert_in_messages(rsp, "You did not approve")
     self.assertEqual(BAD_REQUEST, rsp.status_code)
Exemple #3
0
 def test_user_already_approved(self):
     self.login(self.approver)
     rsp = self.client.post(self.url, data={'approve': True})
     self.assertRedirects(rsp, self.read_url)
     self.login(self.approver)
     rsp = self.client.post(self.url, data={'approve': True}, follow=True)
     self.assertRedirects(rsp, self.read_url)
     assert_in_messages(rsp, "already approved")
Exemple #4
0
 def test_user_already_approved(self):
     self.login(self.approver)
     rsp = self.client.post(self.url, data={'approve': True})
     self.assertRedirects(rsp, self.read_url)
     self.login(self.approver)
     rsp = self.client.post(self.url, data={'approve': True}, follow=True)
     self.assertRedirects(rsp, self.read_url)
     assert_in_messages(rsp, "already approved")