def test_new_ticket_linked_sound(self): test_user = User.objects.get(username='******') ticket = Ticket() ticket.status = 'new' ticket.sender = User.objects.get(username='******') ticket.assignee = User.objects.get(username='******') 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)
def test_new_ticket_linked_content(self): ticket = Ticket() ticket.source = 'new_sound' ticket.status = 'new' ticket.sender = User.objects.get(username='******') ticket.assignee = User.objects.get(username='******') 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='******') lc.save() ticket.content = lc ticket.content.save() self.assertEqual(User.objects.get(username='******').id, ticket.content.object_id)