From e8902c1acdc2f019fd1a93a7ea011735fa85672a Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 22 Feb 2024 22:56:19 -0600 Subject: [PATCH] add test for shadowing --- tests/test_nav.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_nav.py b/tests/test_nav.py index 0c35018..a99fdf1 100644 --- a/tests/test_nav.py +++ b/tests/test_nav.py @@ -121,3 +121,14 @@ def test_extra_context_with_no_extra_context(req): with pytest.raises(AttributeError): assert rendered_item.foo == "bar" + + +def test_extra_context_shadowing(req): + item = NavItem( + title="Test", + url="/test/", + extra_context={"title": "Shadowed"}, + ) + rendered_item = RenderedNavItem(item, req) + + assert rendered_item.title == "Test"