def setUp(self): periodical = models.Periodical(name="Periodical Name", country="USA") periodical.save() self.issue = models.Issue(periodical=periodical, volume=1, issue=10, pub_date=datetime(2013, 11, 1))
def setUp(self): periodical = models.Periodical(name="Periodical Name", country="USA") periodical.save() issue = models.Issue(periodical=periodical, volume=1, issue=10, pub_date=datetime(2013, 11, 1)) issue.save() self.article = models.Article.objects.create(title="Article Title", page=10, issue=issue)
def test_count_is_one_when_one_article(self): periodical = models.Periodical(name="Periodical Name", country="USA") periodical.save() issue = models.Issue(periodical=periodical, volume=1, issue=10, pub_date=datetime(2013, 11, 1)) issue.save() article = models.Article(issue=issue) article.save() tag = ArticleCountNode() self.assertEqual("1", tag.render(None))
def test_one_active(self): periodical = models.Periodical(name="Periodical Name", country="USA") periodical.save() issue = models.Issue(periodical=periodical, volume=1, issue=10, pub_date=datetime(2013, 11, 1)) issue.save() issue.links.create(status=models.LinkItem.STATUS_ACTIVE, url='http://example.com', title='title') self.assertEqual(1, models.LinkItem.active.count())
def test_with_autoescape(self): periodical = models.Periodical(publisher=">ABC Press<", website="http://example.com") self.assertEqual( 'Titles, descriptions and images are copyright <a href="http://example.com">>ABC Press<</a> and are used with permission.', periodical_copyright(periodical, autoescape=True))
def setUp(self): self.periodical = models.Periodical(name="Periodical Name", country="USA")