本文整理匯總了Python中website.addons.dropbox.tests.factories.DropboxNodeSettingsFactory.build方法的典型用法代碼示例。如果您正苦於以下問題:Python DropboxNodeSettingsFactory.build方法的具體用法?Python DropboxNodeSettingsFactory.build怎麽用?Python DropboxNodeSettingsFactory.build使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類website.addons.dropbox.tests.factories.DropboxNodeSettingsFactory
的用法示例。
在下文中一共展示了DropboxNodeSettingsFactory.build方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_clear
# 需要導入模塊: from website.addons.dropbox.tests.factories import DropboxNodeSettingsFactory [as 別名]
# 或者: from website.addons.dropbox.tests.factories.DropboxNodeSettingsFactory import build [as 別名]
def test_clear(self):
node_settings = DropboxNodeSettingsFactory.build()
user_settings = DropboxUserSettingsFactory(access_token="abcde", dropbox_id="abc")
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)
assert_false(user_settings.dropbox_id)
示例2: test_clear_clears_associated_node_settings
# 需要導入模塊: from website.addons.dropbox.tests.factories import DropboxNodeSettingsFactory [as 別名]
# 或者: from website.addons.dropbox.tests.factories.DropboxNodeSettingsFactory import build [as 別名]
def test_clear_clears_associated_node_settings(self):
node_settings = DropboxNodeSettingsFactory.build()
user_settings = DropboxUserSettingsFactory()
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.user_settings, None)
assert_is(node_settings.folder, None)