summaryrefslogtreecommitdiff
path: root/tests/admin_widgets
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2020-04-20 11:37:15 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-05 11:00:05 +0200
commitfb52176a6f38071a540e8187fcb618d1fd152d09 (patch)
tree8b7b7118a39e40f722829e0b2f280ffeccf65e71 /tests/admin_widgets
parentb73e66e75802f10cc34d4880714554cea54dbf49 (diff)
downloaddjango-fb52176a6f38071a540e8187fcb618d1fd152d09.tar.gz
Made DateTimePickerShortcutsSeleniumTests.test_date_time_picker_shortcuts() less flaky.
Moved picking the current time closer to the actual click.
Diffstat (limited to 'tests/admin_widgets')
-rw-r--r--tests/admin_widgets/tests.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py
index 3d9f396d2d..b46753f95f 100644
--- a/tests/admin_widgets/tests.py
+++ b/tests/admin_widgets/tests.py
@@ -938,8 +938,6 @@ class DateTimePickerShortcutsSeleniumTests(AdminWidgetSeleniumTestCase):
if tz_yesterday != tz_tomorrow:
error_margin += timedelta(hours=1)
- now = datetime.now()
-
self.selenium.get(self.live_server_url + reverse('admin:admin_widgets_member_add'))
self.selenium.find_element_by_id('id_name').send_keys('test')
@@ -947,6 +945,7 @@ class DateTimePickerShortcutsSeleniumTests(AdminWidgetSeleniumTestCase):
# Click on the "today" and "now" shortcuts.
shortcuts = self.selenium.find_elements_by_css_selector('.field-birthdate .datetimeshortcuts')
+ now = datetime.now()
for shortcut in shortcuts:
shortcut.find_element_by_tag_name('a').click()