Beispiel #1
0
 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))
Beispiel #4
0
 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">&gt;ABC Press&lt;</a> and are used with permission.',
         periodical_copyright(periodical, autoescape=True))
Beispiel #6
0
 def setUp(self):
     self.periodical = models.Periodical(name="Periodical Name",
                                         country="USA")