本文整理匯總了Python中models.Ticket.assignee方法的典型用法代碼示例。如果您正苦於以下問題:Python Ticket.assignee方法的具體用法?Python Ticket.assignee怎麽用?Python Ticket.assignee使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.Ticket
的用法示例。
在下文中一共展示了Ticket.assignee方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_new_ticket_linked_sound
# 需要導入模塊: from models import Ticket [as 別名]
# 或者: from models.Ticket import assignee [as 別名]
def test_new_ticket_linked_sound(self):
test_user = User.objects.get(username='test_user')
ticket = Ticket()
ticket.status = 'new'
ticket.sender = User.objects.get(username='test_user')
ticket.assignee = User.objects.get(username='test_moderator')
ticket.queue = Queue.objects.get(name=QUEUE_SOUND_MODERATION)
ticket.save()
# just to test, this would be a sound object for example
s = Sound(description='test sound', license_id=1, user=test_user)
s.save()
ticket.sound = s
ticket.save()
self.assertEqual(s.id, ticket.sound.id)
示例2: test_new_ticket_linked_content
# 需要導入模塊: from models import Ticket [as 別名]
# 或者: from models.Ticket import assignee [as 別名]
def test_new_ticket_linked_content(self):
ticket = Ticket()
ticket.source = 'new_sound'
ticket.status = 'new'
ticket.sender = User.objects.get(username='test_user')
ticket.assignee = User.objects.get(username='test_moderator')
ticket.queue = Queue.objects.get(name=QUEUE_SOUND_MODERATION)
ticket.save()
lc = LinkedContent()
# just to test, this would be a sound object for example
lc.content_object = User.objects.get(username='test_admin')
lc.save()
ticket.content = lc
ticket.content.save()
self.assertEqual(User.objects.get(username='test_admin').id,
ticket.content.object_id)