Ejemplo n.º 1
0
    def test_user_should_be_added_as_jury_to_event(self):
        self.assertEqual(self.event.jury.users.count(), 1)
        form = InviteForm(instance=self.event, data={"email": "*****@*****.**"})
        form.is_valid()
        form.add_to_jury()

        self.assertEqual(self.event.jury.users.count(), 2)
Ejemplo n.º 2
0
    def test_user_should_be_added_as_jury_to_event(self):
        self.assertEqual(self.event.jury.users.count(), 1)
        form = InviteForm(instance=self.event,
                          data={'email': '*****@*****.**'})
        form.is_valid()
        form.add_to_jury()

        self.assertEqual(self.event.jury.users.count(), 2)
Ejemplo n.º 3
0
 def test_user_already_a_jury_should_not_be_added_as_jury_to_event(self):
     form = InviteForm(instance=self.event, data={"email": "*****@*****.**"})
     form.is_valid()
     with self.assertRaises(ValidationError):
         form.add_to_jury()
Ejemplo n.º 4
0
 def test_inexistent_user_should_raise_exception(self):
     form = InviteForm(instance=self.event, data={"email": "*****@*****.**"})
     form.is_valid()
     with self.assertRaises(ValidationError):
         form.add_to_jury()
Ejemplo n.º 5
0
 def test_user_already_a_jury_should_not_be_added_as_jury_to_event(self):
     form = InviteForm(instance=self.event,
                       data={'email': '*****@*****.**'})
     form.is_valid()
     with self.assertRaises(ValidationError):
         form.add_to_jury()
Ejemplo n.º 6
0
 def test_inexistent_user_should_raise_exception(self):
     form = InviteForm(instance=self.event,
                       data={'email': '*****@*****.**'})
     form.is_valid()
     with self.assertRaises(ValidationError):
         form.add_to_jury()