Ejemplo n.º 1
0
    def test_changes_fk(self):
        publisher = Publisher.objects.create(name="O'Really")
        publisher2 = Publisher.objects.create(name="Alyson Books")
        p = Publication.objects.create(title='Ponytales')
        p.publisher = publisher
        p.save()
        p.publisher = publisher2
        p.save()

        a = Article.objects.create(headline='How Potatoes Are Made')
        a.publications.add(p)

        view = LatestView.as_view()
        content = view(self.rf.get(reverse('history-latest'))).render()
Ejemplo n.º 2
0
 def test_view(self):
     a = Article.objects.create(headline='Once upon a time')
     view = LatestView.as_view()
     content = view(self.rf.get(reverse('history-latest'))).render()