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:
parent
063784db76
commit
ce266e7f8d
@ -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)
|
Loading…
Reference in New Issue
Block a user