'Regression test for 20182'

def test_limit_choices_to_isnull_true(self):

    Actor.objects.create(name='Palin', age=27)
    Actor.objects.create(name='Kilbraken', age=50, title='Judge')
    response = self.client.get(reverse('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('&amp;', '&')
    popup_url = urljoin(response.request['PATH_INFO'], popup_url)
    response2 = self.client.get(popup_url)
    self.assertNotContains(response2, 'Kilbraken')
    self.assertContains(response2, 'Palin')
