Skip to content

Commit b645a8c

Browse files
committed
Expand document stats test
- Legacy-Id: 12753
1 parent 631295f commit b645a8c

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

ietf/stats/tests.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,19 @@ def test_document_stats(self):
2424
self.assertEqual(r.status_code, 302)
2525
self.assertTrue(authors_url in r["Location"])
2626

27-
authors_all_url = urlreverse(ietf.stats.views.document_stats, kwargs={ "stats_type": "authors", "document_type": "all" })
28-
29-
r = self.client.get(authors_url)
30-
self.assertEqual(r.status_code, 302)
31-
self.assertTrue(authors_all_url in r["Location"])
32-
3327
# check various stats types
34-
for stats_type in ["authors", "pages", "words", "format"]:
35-
for document_type in ["all", "rfc", "draft"]:
36-
url = urlreverse(ietf.stats.views.document_stats, kwargs={ "stats_type": stats_type, "document_type": document_type })
37-
r = self.client.get(url)
38-
self.assertEqual(r.status_code, 200)
39-
q = PyQuery(r.content)
40-
self.assertTrue(q('#chart'))
41-
self.assertTrue(q('table.stats-data'))
28+
for stats_type in ["authors", "pages", "words", "format", "formlang"]:
29+
for document_type in ["", "rfc", "draft"]:
30+
for time_choice in ["", "5y"]:
31+
url = urlreverse(ietf.stats.views.document_stats, kwargs={ "stats_type": stats_type })
32+
r = self.client.get(url, {
33+
"type": document_type,
34+
"time": time_choice,
35+
})
36+
self.assertEqual(r.status_code, 200)
37+
q = PyQuery(r.content)
38+
self.assertTrue(q('#chart'))
39+
self.assertTrue(q('table.stats-data'))
4240

4341
def test_review_stats(self):
4442
doc = make_test_data()

0 commit comments

Comments
 (0)