def test_article_has_title(self): """ Test that an article must have an associated title. """ article = Article(title='') with self.assertRaises(ValidationError): article.save() article.full_clean()
def test_has_body(self): """ Test that an article must have an associated body. """ article = Article(body='') with self.assertRaises(ValidationError): article.save() article.full_clean()
def test_all_sections_must_be_filled(self): article = Article(author=None, title='', text='', description='', tags='', created_date='') with self.assertRaises(ValidationError): article.save() article.full_clean()