@@ -279,6 +279,46 @@ def test_public_home_falls_back_to_defaults_when_shortcuts_missing(self):
279279 self .assertIn (reverse ("pretty_pair" ), content )
280280 self .assertIn (reverse ("missing_ballots" ), content )
281281
282+ def test_public_home_shows_only_seven_shortcuts_when_motions_enabled (self ):
283+ client = Client ()
284+ TabSettings .set ("motions_enabled" , 1 )
285+
286+ defaults = PublicHomeShortcut .default_slot_mapping ()
287+ for position , nav_item in defaults .items ():
288+ PublicHomeShortcut .objects .update_or_create (
289+ position = position ,
290+ defaults = {"nav_item" : nav_item },
291+ )
292+
293+ caches ["public" ].clear ()
294+ response = client .get (reverse ("public_home" ))
295+ self .assertEqual (response .status_code , 200 )
296+ content = response .content .decode ()
297+
298+ self .assertEqual (content .count ('class="tile shadow-sm"' ), 7 )
299+ self .assertNotIn ('<span class="title">Motions</span>' , content )
300+
301+ def test_public_home_can_show_motions_when_selected_as_shortcut (self ):
302+ client = Client ()
303+ TabSettings .set ("motions_enabled" , 1 )
304+
305+ defaults = PublicHomeShortcut .default_slot_mapping ()
306+ defaults [1 ] = "public_motions"
307+ for position , nav_item in defaults .items ():
308+ PublicHomeShortcut .objects .update_or_create (
309+ position = position ,
310+ defaults = {"nav_item" : nav_item },
311+ )
312+
313+ caches ["public" ].clear ()
314+ response = client .get (reverse ("public_home" ))
315+ self .assertEqual (response .status_code , 200 )
316+ content = response .content .decode ()
317+
318+ self .assertEqual (content .count ('class="tile shadow-sm"' ), 7 )
319+ self .assertIn ('<span class="title">Motions</span>' , content )
320+ self .assertIn (reverse ("public_motions" ), content )
321+
282322 def test_public_rankings_control_updates_display_settings (self ):
283323 client = Client ()
284324 user = get_user_model ().objects .create_superuser (
0 commit comments