'Test toggling the malicious and deprecated repository flags.'

def test_0045_alter_repository_states(self):

    repository = self.test_db_util.get_repository_by_name_and_owner(repository_name, common.test_user_1_name)
    self.login(email=common.admin_email, username=common.admin_username)
    self.set_repository_malicious(repository, set_malicious=True, strings_displayed=['The    repository    tip    has    been    defined    as    malicious.'])
    self.set_repository_malicious(repository, set_malicious=False, strings_displayed=['The    repository    tip    has    been    defined    as    <b>not</b>    malicious.'])
    self.login(email=common.test_user_1_email, username=common.test_user_1_name)
    self.set_repository_deprecated(repository, strings_displayed=['has    been    marked    as    deprecated'])
    strings_displayed = ['This    repository    has    been    marked    as    deprecated', 'Mark    repository    as    not    deprecated']
    self.display_manage_repository_page(repository, strings_displayed=strings_displayed, strings_not_displayed=['Upload    files', 'Reset    all    repository    metadata'])
    self.browse_repository(repository, strings_not_displayed=['Upload    files'])
    self.set_repository_deprecated(repository, strings_displayed=['has    been    marked    as    not    deprecated'], set_deprecated=False)
    strings_displayed = ['Mark    repository    as    deprecated', 'Upload    files', 'Reset    all    repository    metadata']
    self.display_manage_repository_page(repository, strings_displayed=strings_displayed)
