本文整理汇总了Python中core.models.User._id方法的典型用法代码示例。如果您正苦于以下问题:Python User._id方法的具体用法?Python User._id怎么用?Python User._id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.models.User
的用法示例。
在下文中一共展示了User._id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_ne
# 需要导入模块: from core.models import User [as 别名]
# 或者: from core.models.User import _id [as 别名]
def test_ne(self):
user = User(login='test_login')
user._id = 1
player = PlayerOrig.from_user(user=user)
user2 = User(login='test_login')
user2._id = 2
player2 = PlayerOrig.from_user(user=user2)
user3 = User(login='test_login2')
player3 = PlayerOrig.from_user(user=user2)
self.assertNotEqual(player, player2)
self.assertNotEqual(player, player3)
示例2: test_eq
# 需要导入模块: from core.models import User [as 别名]
# 或者: from core.models.User import _id [as 别名]
def test_eq(self):
user = User(login='test_login')
user._id = 1
user2 = User(login='test_login2')
player = PlayerOrig.from_user(user=user)
player2 = PlayerOrig.from_user(user=user)
self.assertEqual(player, player2)
player3 = PlayerOrig.from_user(user=user2)
self.assertNotEqual(player, player3)
self.assertNotEqual(player3, player3)
self.assertNotEqual(player3, None)