samedi 27 mai 2017

I have written this test returning status code 404 while there are other same tests but they are running OK and returning status code 200

Do not know why this test returning 404 instead of 200. Plz help.

def test_portal_day_archive_view(self):
    self.entry = Entry.objects.create(pub_date=self.now, is_active=True, headline='active', slug='b')
    url = reverse('portal:archive_day', kwargs={'year': self.entry.pub_date.year,
                                                'month': self.entry.pub_date.strftime('%b').lower(),
                                                'day': self.entry.pub_date.strftime('%d')}
                )
    self.assertEqual(200, self.client.get(url).status_code)

Aucun commentaire:

Enregistrer un commentaire