'The foreign key widget should only show the "add related" button if the
user has permission to add that related item.'

def test_conditionally_show_add_section_link(self):

    self.client.force_login(self.adduser)
    url = reverse('admin:admin_views_article_add')
    add_link_text = 'add_id_section'
    response = self.client.get(url)
    self.assertNotContains(response, add_link_text)
    user = User.objects.get(username='adduser')
    perm = get_perm(Section, get_permission_codename('add', Section._meta))
    user.user_permissions.add(perm)
    response = self.client.get(url)
    self.assertContains(response, add_link_text)
