'Scenario: Admins should be able to remove other admins
Given I have opened a new course in Studio
And I grant admin rights to other user
Then he can add, delete, promote and demote users
And I am viewing the course team settings
When I remove admin rights from other user
And other user logs in
And he selects the new course
And he views the course team settings
Then other user should not be marked as an admin
And he cannot manage users'

def test_admins_should_be_able_to_remove_other_admins(self):

    self.page.add_user_to_course(self.other_user.get('email'))
    self._assert_user_present(self.other_user, present=True)
    other = self.page.get_user(self.other_user.get('email'))
    self._assert_is_staff(other)
    other.click_promote()
    self._refresh_page()
    other = self.page.get_user(self.other_user.get('email'))
    self._assert_is_admin(other)
    self.log_in(self.other_user)
    self._go_to_course_team_page()
    other = self.page.get_user(self.other_user.get('email'))
    self.assertTrue(other.is_current_user)
    self._assert_can_manage_users()
    self.log_in(self.user)
    self._go_to_course_team_page()
    other = self.page.get_user(self.other_user.get('email'))
    other.click_demote()
    self._refresh_page()
    other = self.page.get_user(self.other_user.get('email'))
    self._assert_is_staff(other)
    self.log_in(self.other_user)
    self._go_to_course_team_page()
    other = self.page.get_user(self.other_user.get('email'))
    self.assertTrue(other.is_current_user)
    self._assert_can_not_manage_users()
