本文整理汇总了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)