本文整理匯總了Python中website.addons.googledrive.tests.factories.GoogleDriveNodeSettingsFactory.build方法的典型用法代碼示例。如果您正苦於以下問題:Python GoogleDriveNodeSettingsFactory.build方法的具體用法?Python GoogleDriveNodeSettingsFactory.build怎麽用?Python GoogleDriveNodeSettingsFactory.build使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類website.addons.googledrive.tests.factories.GoogleDriveNodeSettingsFactory
的用法示例。
在下文中一共展示了GoogleDriveNodeSettingsFactory.build方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_clear
# 需要導入模塊: from website.addons.googledrive.tests.factories import GoogleDriveNodeSettingsFactory [as 別名]
# 或者: from website.addons.googledrive.tests.factories.GoogleDriveNodeSettingsFactory import build [as 別名]
def test_clear(self):
node_settings = GoogleDriveNodeSettingsFactory.build()
user_settings = GoogleDriveUserSettingsFactory(access_token='abcde')
node_settings.user_settings = user_settings
node_settings.save()
assert_true(user_settings.access_token)
user_settings.clear()
user_settings.save()
assert_false(user_settings.access_token)
示例2: test_clear_clears_associated_node_settings
# 需要導入模塊: from website.addons.googledrive.tests.factories import GoogleDriveNodeSettingsFactory [as 別名]
# 或者: from website.addons.googledrive.tests.factories.GoogleDriveNodeSettingsFactory import build [as 別名]
def test_clear_clears_associated_node_settings(self):
node_settings = GoogleDriveNodeSettingsFactory.build()
user_settings = GoogleDriveUserSettingsFactory()
node_settings.user_settings = user_settings
node_settings.save()
user_settings.clear()
user_settings.save()
# Node settings no longer associated with user settings
assert_is(node_settings.folder_id, None)
assert_is(node_settings.user_settings, None)
示例3: test_clear_wo_oauth_settings
# 需要導入模塊: from website.addons.googledrive.tests.factories import GoogleDriveNodeSettingsFactory [as 別名]
# 或者: from website.addons.googledrive.tests.factories.GoogleDriveNodeSettingsFactory import build [as 別名]
def test_clear_wo_oauth_settings(self, mock_revoke_access_token):
user_settings = GoogleDriveUserSettingsFactory(access_token='abcde')
user_settings.oauth_settings = None
user_settings.save()
node_settings = GoogleDriveNodeSettingsFactory.build()
node_settings.user_settings = user_settings
node_settings.save()
assert_false(user_settings.oauth_settings)
user_settings.clear()
user_settings.save()
assert_false(mock_revoke_access_token.called)