def test_0000_initiate_users( self ): """Create necessary user accounts and login as an admin user.""" for info in repositories: email = info["owner"]+tmail username = info["owner"] self.logout() self.login( email=email, username=username ) tmp_user = test_db_util.get_user( email ) tmp_user_private_role = test_db_util.get_private_role( tmp_user ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) admin_user = test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email admin_user_private_role = test_db_util.get_private_role( admin_user )
def test_0000_initiate_users( self ): """Create necessary user accounts and login as an admin user.""" self.logout() self.login( email=common.admin_email, username=common.admin_username ) admin_user = test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email admin_user_private_role = test_db_util.get_private_role( admin_user )
def test_0100_verify_reserved_username_handling( self ): '''Check that reserved usernames are handled correctly.''' self.logout() self.login( email='*****@*****.**', username='******' ) test_user_1 = test_db_util.get_user( '*****@*****.**' ) assert test_user_1 is None, 'Creating user with public name "repos" succeeded.' error_message = 'The term <b>repos</b> is a reserved word in the tool shed, so it cannot be used as a public user name.' self.check_for_strings( strings_displayed=[ error_message ] )