本文整理汇总了Python中tool_shed.base.test_db_util.get_private_role函数的典型用法代码示例。如果您正苦于以下问题:Python get_private_role函数的具体用法?Python get_private_role怎么用?Python get_private_role使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_private_role函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_0000_initiate_users
def test_0000_initiate_users(self):
"""Create necessary user accounts and login as an admin user."""
"""
We are at step 1.
Create all the user accounts that are needed for this test script to run independently of other test.
Previously created accounts will not be re-created.
"""
self.logout()
self.login(email=common.test_user_1_email, username=common.test_user_1_name)
test_user_1 = test_db_util.get_user(common.test_user_1_email)
assert test_user_1 is not None, (
"Problem retrieving user with email %s from the database" % common.test_user_1_email
)
test_user_1_private_role = test_db_util.get_private_role(test_user_1)
self.logout()
self.login(email=common.test_user_2_email, username=common.test_user_2_name)
test_user_2 = test_db_util.get_user(common.test_user_2_email)
assert test_user_2 is not None, (
"Problem retrieving user with email %s from the database" % common.test_user_2_email
)
test_user_2_private_role = test_db_util.get_private_role(test_user_2)
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)
示例2: test_0000_initiate_users
def test_0000_initiate_users( self ):
"""Create necessary user accounts and login as an admin user."""
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
test_user_1 = test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email
test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
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 )