retro: create tests for retro pages

Added tests for the known year pages and the 404 case. With theses tests
the retro pages have 100% test coverage
This commit is contained in:
Jelle van der Waa 2017-05-28 17:27:29 +02:00
parent 063784db76
commit ce266e7f8d

View File

@ -0,0 +1,14 @@
from django.test import TestCase
from retro.views import RETRO_YEAR_MAP
class RetroTest(TestCase):
def test_404(self):
response = self.client.get('/retro/1999/')
self.assertEqual(response.status_code, 404)
def test_retro(self):
for year, _ in RETRO_YEAR_MAP.items():
response = self.client.get('/retro/{}/'.format(year))
self.assertEqual(response.status_code, 200)