本文整理匯總了Python中models.Ticket.sound方法的典型用法代碼示例。如果您正苦於以下問題:Python Ticket.sound方法的具體用法?Python Ticket.sound怎麽用?Python Ticket.sound使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.Ticket
的用法示例。
在下文中一共展示了Ticket.sound方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_new_ticket_linked_sound
# 需要導入模塊: from models import Ticket [as 別名]
# 或者: from models.Ticket import sound [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)