Exemplo n.º 1
0
class EventTestcase(unittest.TestCase):
  def test1(self):
        self.event = Event(title="some_title", description="some description")
        self.assertRaises(ValidationError, self.event.clean())

  def test2(self):
        user1 = User(user_name = "Saravanan", password="******", email = "*****@*****.**")
        user1.save()
        self.event = Event(title = "Some title", description="some description",
                           people_wants_to_meet="saravanan",
                           time_of_event="2012-12-18", user = user1)
        self.assertIsNone(self.event.full_clean())

  def test3(self):
    data = {'title': 'Saravanan', 'description': 'something', 'people_wants_to_meet': 'Venkateswari', 'time_of_event': '2013-06-26'}
    event_form = EventForm(data)
    self.assertTrue(event_form.is_valid())