summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSkyiesac <jainsachi1202@gmail.com>2026-03-31 18:18:18 +0530
committerJacob Walls <jacobtylerwalls@gmail.com>2026-05-20 12:02:15 -0400
commit3ca621a38642bfd8fc2bfd308f489cc2d9e76fb0 (patch)
tree89fe0c429473ce10f6181fedd42e88bdbb530e4f /tests
parent4ea7648df5f970593e3cbe222a19fb624fa7208c (diff)
Fixed #36458 -- Trapped focus in the admin calendar and clock widgets.
Diffstat (limited to 'tests')
-rw-r--r--tests/admin_widgets/tests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py
index b1db728f67..a607f1fedc 100644
--- a/tests/admin_widgets/tests.py
+++ b/tests/admin_widgets/tests.py
@@ -1203,6 +1203,22 @@ class DateTimePickerSeleniumTests(AdminWidgetSeleniumTestCase):
# The right month and year are displayed.
self.wait_for_text("#calendarin0 caption", expected_caption)
+ def test_calendar_press_enter_focus_element(self):
+ from selenium.webdriver.common.by import By
+ from selenium.webdriver.common.keys import Keys
+
+ self.admin_login(username="super", password="secret", login_url="/")
+ self.selenium.get(
+ self.live_server_url + reverse("admin:admin_widgets_member_add")
+ )
+ icon = self.selenium.find_element(By.ID, "calendarlink0")
+ expected_focus_element = self.selenium.find_element(
+ By.CSS_SELECTOR, "div#calendarin0 table td.today a"
+ )
+ icon.send_keys(Keys.ENTER)
+ focused_element = self.selenium.switch_to.active_element
+ self.assertEqual(expected_focus_element, focused_element)
+
@override_settings(TIME_ZONE="Asia/Seoul")
def test_timezone_warning_message(self):
from selenium.webdriver.common.by import By