datatracker/ietf/help/tests_views.py

31 lines
921 B
Python

"""
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from pyquery import PyQuery
from django.core.urlresolvers import reverse
import debug # pyflakes:ignore
from ietf.utils.test_utils import TestCase
from ietf.doc.models import StateType
class StateHelpTest(TestCase):
def test_state_index(self):
url = reverse('ietf.help.views.state_index')
r = self.client.get(url)
q = PyQuery(r.content)
content = [ e.text for e in q('#content table td a ') ]
names = StateType.objects.values_list('slug', flat=True)
# The following doesn't cover all doc types, only a selection
for name in names:
if not '-' in name:
self.assertIn(name, content)