'Do show leave button for a group whose members_can_leave flag
is True, for group member'

def test_show_leave_button_value_members_can_leave(self):

    group = GroupFactory.create(members_can_leave=True)
    user = UserFactory.create()
    group.add_member(user.userprofile)
    url = reverse('groups:show_group', kwargs={'url': group.url})
    with self.login(user) as client:
        response = client.get(url, follow=True)
    eq_(response.status_code, 200)
    eq_(response.context['show_leave_button'], True)
    ok_((not response.context['is_pending']))
