'Test that giving a user an org role enables access appropriately'

def test_org_role(self):

    self.assertFalse(OrgStaffRole(self.course_key.org).has_user(self.student), 'Student    has    premature    access    to    {}'.format(self.course_key.org))
    OrgStaffRole(self.course_key.org).add_users(self.student)
    self.assertTrue(OrgStaffRole(self.course_key.org).has_user(self.student), "Student    doesn't    have    access    to    {}".format(unicode(self.course_key.org)))
    OrgStaffRole(self.course_key.org).remove_users(self.student)
    if hasattr(self.student, '_roles'):
        del self.student._roles
    self.assertFalse(OrgStaffRole(self.course_key.org).has_user(self.student), 'Student    still    has    access    to    {}'.format(self.course_key.org))
