From 9e0126663b92a2bea41b4c2f25c46bd620ff33d6 Mon Sep 17 00:00:00 2001 From: Joshua Carp Date: Fri, 29 Apr 2016 18:54:12 -0400 Subject: [PATCH] Set correct page type on diff navigation footer. [Resolves #312] --- regulations/tests/views_diff_tests.py | 1 + regulations/views/diff.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/regulations/tests/views_diff_tests.py b/regulations/tests/views_diff_tests.py index d695bd863..7ccbc3b26 100644 --- a/regulations/tests/views_diff_tests.py +++ b/regulations/tests/views_diff_tests.py @@ -159,6 +159,7 @@ def assert_correct_nav(self, section_id, prev, following): """Verify that the generated nav contains the appropriate url entries for prev and next""" nav = self.view.footer_nav(section_id, self.toc, self.versions) + self.assertEqual(nav['page_type'], 'diff') if prev: self.assert_url_contains_versions(nav['previous']['url'], prev) else: diff --git a/regulations/views/diff.py b/regulations/views/diff.py index 2d50ee529..2e2f5ca03 100644 --- a/regulations/views/diff.py +++ b/regulations/views/diff.py @@ -67,6 +67,9 @@ def footer_nav(self, label, toc, versions): for entry in nav.values(): entry['url'] = reverse_chrome_diff_view( entry['section_id'], *versions) + + nav['page_type'] = 'diff' + return nav def get_context_data(self, **kwargs):