@@ -135,3 +135,27 @@ def test_law_report_volume_detail_view_filters_to_selected_volume(self):
135135 self .assertNotContains (response , self .second_judgment .title )
136136 self .assertNotContains (response , self .unrelated_judgment .title )
137137 self .assertEqual (self .volume_1 , response .context ["law_report_volume" ])
138+ self .assertEqual ("judgments" , response .context ["active_tab" ])
139+
140+ def test_law_report_volume_detail_view_cases_tab (self ):
141+ url = self .volume_1 .get_absolute_url () + "?tab=cases"
142+ response = self .client .get (url )
143+
144+ self .assertEqual (response .status_code , 200 )
145+ self .assertEqual ("cases" , response .context ["active_tab" ])
146+ self .assertTrue (response .context .get ("doc_table_toggle" ))
147+
148+ def test_law_report_volume_detail_view_legislation_tab (self ):
149+ url = self .volume_1 .get_absolute_url () + "?tab=legislation"
150+ response = self .client .get (url )
151+
152+ self .assertEqual (response .status_code , 200 )
153+ self .assertEqual ("legislation" , response .context ["active_tab" ])
154+ self .assertTrue (response .context .get ("doc_table_toggle" ))
155+
156+ def test_law_report_volume_detail_view_invalid_tab_defaults_to_judgments (self ):
157+ url = self .volume_1 .get_absolute_url () + "?tab=invalid"
158+ response = self .client .get (url )
159+
160+ self .assertEqual (response .status_code , 200 )
161+ self .assertEqual ("judgments" , response .context ["active_tab" ])
0 commit comments