'Typing in the search box filters out options displayed in the \'from\'
box.'

def test_filter(self):

    from selenium.webdriver.common.keys import Keys
    self.school.students.set([self.lisa, self.peter])
    self.school.alumni.set([self.lisa, self.peter])
    self.admin_login(username='super', password='secret', login_url='/')
    self.selenium.get((self.live_server_url + reverse('admin:admin_widgets_school_change', args=(self.school.id,))))
    for field_name in ['students', 'alumni']:
        from_box = ('#id_%s_from' % field_name)
        to_box = ('#id_%s_to' % field_name)
        choose_link = ('id_%s_add_link' % field_name)
        remove_link = ('id_%s_remove_link' % field_name)
        input = self.selenium.find_element_by_id(('id_%s_input' % field_name))
        self.assertSelectOptions(from_box, [str(self.arthur.id), str(self.bob.id), str(self.cliff.id), str(self.jason.id), str(self.jenny.id), str(self.john.id)])
        input.send_keys('a')
        self.assertSelectOptions(from_box, [str(self.arthur.id), str(self.jason.id)])
        input.send_keys('R')
        self.assertSelectOptions(from_box, [str(self.arthur.id)])
        input.send_keys([Keys.BACK_SPACE])
        self.assertSelectOptions(from_box, [str(self.arthur.id), str(self.jason.id)])
        input.send_keys([Keys.BACK_SPACE])
        self.assertSelectOptions(from_box, [str(self.arthur.id), str(self.bob.id), str(self.cliff.id), str(self.jason.id), str(self.jenny.id), str(self.john.id)])
        input.send_keys('a')
        self.assertSelectOptions(from_box, [str(self.arthur.id), str(self.jason.id)])
        self.get_select_option(from_box, str(self.jason.id)).click()
        self.selenium.find_element_by_id(choose_link).click()
        self.assertSelectOptions(from_box, [str(self.arthur.id)])
        self.assertSelectOptions(to_box, [str(self.lisa.id), str(self.peter.id), str(self.jason.id)])
        self.get_select_option(to_box, str(self.lisa.id)).click()
        self.selenium.find_element_by_id(remove_link).click()
        self.assertSelectOptions(from_box, [str(self.arthur.id), str(self.lisa.id)])
        self.assertSelectOptions(to_box, [str(self.peter.id), str(self.jason.id)])
        input.send_keys([Keys.BACK_SPACE])
        self.assertSelectOptions(from_box, [str(self.arthur.id), str(self.bob.id), str(self.cliff.id), str(self.jenny.id), str(self.john.id), str(self.lisa.id)])
        self.assertSelectOptions(to_box, [str(self.peter.id), str(self.jason.id)])
        self.get_select_option(to_box, str(self.jason.id)).click()
        self.selenium.find_element_by_id(remove_link).click()
        input.send_keys('ja')
        self.assertSelectOptions(from_box, [str(self.jason.id)])
        input.send_keys([Keys.ENTER])
        self.assertSelectOptions(to_box, [str(self.peter.id), str(self.jason.id)])
        input.send_keys([Keys.BACK_SPACE, Keys.BACK_SPACE])
    self.selenium.find_element_by_xpath('//input[@value="Save"]').click()
    self.wait_page_loaded()
    self.school = School.objects.get(id=self.school.id)
    self.assertEqual(list(self.school.students.all()), [self.jason, self.peter])
    self.assertEqual(list(self.school.alumni.all()), [self.jason, self.peter])
