'Rename the repository as user2.'

def test_0040_rename_repository_as_repository_admin(self):

    '\n                                This    is    step    8    -    Log    into    the    Tool    Shed    as    user    user2    and    make    sure    the    repository    name    and    description    can    now    be    changed.\n                                '
    self.login(email=common.test_user_2_email, username=common.test_user_2_name)
    repository = self.test_db_util.get_repository_by_name_and_owner('renamed_filtering_0530', common.test_user_1_name)
    self.edit_repository_information(repository, revert=False, repo_name='filtering_0530')
    self.test_db_util.refresh(repository)
    assert (repository.name == 'filtering_0530'), 'User    with    admin    role    failed    to    rename    repository.'
    test_user_1 = self.test_db_util.get_user(common.test_user_1_email)
    old_repository_admin_role = self.test_db_util.get_role(test_user_1, 'renamed_filtering_0530_user1_admin')
    assert (old_repository_admin_role is None), 'Admin    role    renamed_filtering_0530_user1_admin    incorrectly    exists.'
    new_repository_admin_role = self.test_db_util.get_role(test_user_1, 'filtering_0530_user1_admin')
    assert (new_repository_admin_role is not None), 'Admin    role    filtering_0530_user1_admin    does    not    exist.'
