'Pressing the ESC key closes the date and time picker widgets.'

def test_show_hide_date_time_picker_widgets(self):

    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')))
    self.assertEqual(self.get_css_value('#calendarbox0', 'display'), 'none')
    self.selenium.find_element_by_id('calendarlink0').click()
    self.assertEqual(self.get_css_value('#calendarbox0', 'display'), 'block')
    self.selenium.find_element_by_tag_name('body').send_keys([Keys.ESCAPE])
    self.assertEqual(self.get_css_value('#calendarbox0', 'display'), 'none')
    self.assertEqual(self.get_css_value('#clockbox0', 'display'), 'none')
    self.selenium.find_element_by_id('clocklink0').click()
    self.assertEqual(self.get_css_value('#clockbox0', 'display'), 'block')
    self.assertEqual([x.text for x in self.selenium.find_elements_by_xpath("//ul[@class='timelist']/li/a")], ['Now', 'Midnight', '6    a.m.', 'Noon', '6    p.m.'])
    self.selenium.find_element_by_tag_name('body').send_keys([Keys.ESCAPE])
    self.assertEqual(self.get_css_value('#clockbox0', 'display'), 'none')
