Expand document stats test

- Legacy-Id: 12753
This commit is contained in:
Ole Laursen 2017-01-30 14:01:40 +00:00
parent 631295f7db
commit b645a8c0f9

View file

@ -24,21 +24,19 @@ class StatisticsTests(TestCase):
self.assertEqual(r.status_code, 302)
self.assertTrue(authors_url in r["Location"])
authors_all_url = urlreverse(ietf.stats.views.document_stats, kwargs={ "stats_type": "authors", "document_type": "all" })
r = self.client.get(authors_url)
self.assertEqual(r.status_code, 302)
self.assertTrue(authors_all_url in r["Location"])
# check various stats types
for stats_type in ["authors", "pages", "words", "format"]:
for document_type in ["all", "rfc", "draft"]:
url = urlreverse(ietf.stats.views.document_stats, kwargs={ "stats_type": stats_type, "document_type": document_type })
r = self.client.get(url)
self.assertEqual(r.status_code, 200)
q = PyQuery(r.content)
self.assertTrue(q('#chart'))
self.assertTrue(q('table.stats-data'))
for stats_type in ["authors", "pages", "words", "format", "formlang"]:
for document_type in ["", "rfc", "draft"]:
for time_choice in ["", "5y"]:
url = urlreverse(ietf.stats.views.document_stats, kwargs={ "stats_type": stats_type })
r = self.client.get(url, {
"type": document_type,
"time": time_choice,
})
self.assertEqual(r.status_code, 200)
q = PyQuery(r.content)
self.assertTrue(q('#chart'))
self.assertTrue(q('table.stats-data'))
def test_review_stats(self):
doc = make_test_data()