本文整理匯總了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)