本文整理汇总了Python中osf_tests.factories.UserFactory.merge_user方法的典型用法代码示例。如果您正苦于以下问题:Python UserFactory.merge_user方法的具体用法?Python UserFactory.merge_user怎么用?Python UserFactory.merge_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osf_tests.factories.UserFactory
的用法示例。
在下文中一共展示了UserFactory.merge_user方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_serialize_user_merged
# 需要导入模块: from osf_tests.factories import UserFactory [as 别名]
# 或者: from osf_tests.factories.UserFactory import merge_user [as 别名]
def test_serialize_user_merged(self):
master = UserFactory()
user = UserFactory()
master.merge_user(user)
d = utils.serialize_user(user, full=True)
assert_true(d['is_merged'])
assert_equal(d['merged_by']['url'], user.merged_by.url)
assert_equal(d['merged_by']['absolute_url'], user.merged_by.absolute_url)
示例2: test_serialize_user
# 需要导入模块: from osf_tests.factories import UserFactory [as 别名]
# 或者: from osf_tests.factories.UserFactory import merge_user [as 别名]
def test_serialize_user(self):
master = UserFactory()
user = UserFactory()
master.merge_user(user)
d = utils.serialize_user(user)
assert_equal(d['id'], user._primary_key)
assert_equal(d['url'], user.url)
assert_equal(d.get('username', None), None)
assert_equal(d['fullname'], user.fullname)
assert_equal(d['registered'], user.is_registered)
assert_equal(d['absolute_url'], user.absolute_url)
assert_equal(d['date_registered'], user.date_registered.strftime('%Y-%m-%d'))
assert_equal(d['active'], user.is_active)