def test_get_title(self): review = ReviewFactory(title='Some Title') self.assertEqual(review.get_title(), review.title) review = ReviewFactory() self.assertEqual(review.get_title(), 'Review: {}'.format(review.production))
def test_save(self): review = ReviewFactory(pk=None, title=None, slug=None) with patch('django.db.models.Model.save') as mock_save: review.save() self.assertEqual(review.title, review.get_title()) self.assertEqual(review.slug, review.get_slug()) mock_save.assert_called_once_with()
def test_unicode(self): review = ReviewFactory() self.assertEqual(review.__unicode__(), unicode(review.get_title()))