From b645a8c0f9fcd3bab190defd4f974defeff46bc1 Mon Sep 17 00:00:00 2001 From: Ole Laursen Date: Mon, 30 Jan 2017 14:01:40 +0000 Subject: [PATCH] Expand document stats test - Legacy-Id: 12753 --- ietf/stats/tests.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/ietf/stats/tests.py b/ietf/stats/tests.py index 54017208e..7bb1ab230 100644 --- a/ietf/stats/tests.py +++ b/ietf/stats/tests.py @@ -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()