def test_full_validate_fills_language_field(self): article = ArticleFactory.build( text='Период: Дней: 30<br /><br />Бюджет: 30000 RUB<br /> Пишите в телеграм или на почту' ) a = Article.objects.clean_create( **model_to_dict(article) ) self.assertIsNotNone(a.language)
def test_title_generated_upon_clean(self): article = ArticleFactory.build( title=None, source=DataSourceFactory() ) article.full_clean() article.save() article.refresh_from_db() self.assertIsNotNone(article.title)