本文整理匯總了Python中allianceauth.tests.auth_utils.AuthUtils.create_state方法的典型用法代碼示例。如果您正苦於以下問題:Python AuthUtils.create_state方法的具體用法?Python AuthUtils.create_state怎麽用?Python AuthUtils.create_state使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類allianceauth.tests.auth_utils.AuthUtils
的用法示例。
在下文中一共展示了AuthUtils.create_state方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setUpTestData
# 需要導入模塊: from allianceauth.tests.auth_utils import AuthUtils [as 別名]
# 或者: from allianceauth.tests.auth_utils.AuthUtils import create_state [as 別名]
def setUpTestData(cls):
cls.user = AuthUtils.create_user('test')
AuthUtils.add_main_character(cls.user, 'test character', '1', corp_id='2', corp_name='test_corp', corp_ticker='TEST', alliance_id='3', alliance_name='TEST')
cls.user.profile.refresh_from_db()
cls.alliance = EveAllianceInfo.objects.create(alliance_id='3', alliance_name='test alliance', alliance_ticker='TEST', executor_corp_id='2')
cls.corp = EveCorporationInfo.objects.create(corporation_id='2', corporation_name='test corp', corporation_ticker='TEST', alliance=cls.alliance, member_count=1)
cls.token = Token.objects.create(user=cls.user, access_token='a', character_id='1', character_name='test character', character_owner_hash='z')
cls.corpstats = CorpStats.objects.create(corp=cls.corp, token=cls.token)
cls.view_corp_permission = Permission.objects.get_by_natural_key('view_corp_corpstats', 'corputils', 'corpstats')
cls.view_alliance_permission = Permission.objects.get_by_natural_key('view_alliance_corpstats', 'corputils', 'corpstats')
cls.view_state_permission = Permission.objects.get_by_natural_key('view_state_corpstats', 'corputils', 'corpstats')
cls.state = AuthUtils.create_state('test state', 500)
AuthUtils.assign_state(cls.user, cls.state, disconnect_signals=True)