lundi 28 mars 2016

django test the correct template used: with self.assertTemplateUsed()

I used to see the following tests in Django:

with self.assertTemplateUsed('<someTemplate>'):
    response = self.client.get('<someURL>')
    self.assertEqual(response.status_code, 200)

Question:

Since we have already had the with part, is it necessary to test the status_code? In other words, is the final statement redundant?

Aucun commentaire:

Enregistrer un commentaire