'Regression test for 20182'

def test_limit_choices_to_isnull_true(self):

    Actor.objects.create(name=u'Palin', age=27)
    Actor.objects.create(name=u'Kilbraken', age=50, title=u'Judge')
    response = self.client.get(u'/test_admin/admin/admin_views/sketch/add/')
    m = re.search('<a    href="([^"]*)"[^>]*    id="lookup_id_defendant1"', 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.assertNotContains(response2, u'Kilbraken')
    self.assertContains(response2, u'Palin')
