Exemplo n.º 1
0
 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()
Exemplo n.º 2
0
 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()
Exemplo n.º 3
0
 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()