'Regression test for 14880'

def test_limit_choices_to(self):

    actor = Actor.objects.create(name=u'Palin', age=27)
    inquisition1 = Inquisition.objects.create(expected=True, leader=actor, country=u'England')
    inquisition2 = Inquisition.objects.create(expected=False, leader=actor, country=u'Spain')
    response = self.client.get(u'/test_admin/admin/admin_views/sketch/add/')
    m = re.search('<a    href="([^"]*)"[^>]*    id="lookup_id_inquisition"', response.content)
    self.assertTrue(m)
    popup_url = m.groups()[0].decode().replace(u'&amp;', u'&')
    popup_url = urljoin(response.request[u'PATH_INFO'], popup_url)
    response2 = self.client.get(popup_url)
    self.assertContains(response2, u'Spain')
    self.assertNotContains(response2, u'England')
