def test_too_long_surname_should_throw_error(self): director = Director(name='steven', surname='a' * 41) with self.assertRaises(ValidationError): director.full_clean()
def test_too_long_name_should_throw_error(self): director = Director(name='a' * 21, surname='spilberg') with self.assertRaises(ValidationError): director.full_clean()
def test_deleting_none_existing_director_should_error_throw(self): director = Director(name='steven', surname='spilberg') with self.assertRaises(AssertionError): director.delete()
def test_empty_surname_should_throw_error(self): director = Director(name='ennio') with self.assertRaises(ValidationError): director.full_clean()
def test_deleting_existing_director_should_pass(self): director = Director(name='steven', surname='spilberg') director.save() director.delete() self.assertEqual(0, Director.objects.count())