def test_open_method_raise_exception_if_not_new(self): """ Test that calling of open method on ticket with not "new" status raise an ValueError exception. """ ticket = Ticket() ticket.status = Ticket.STATUS.closed self.assertRaisesMessage(TicketIsNotNewError, 'Ticket not in status "New"', ticket.opening, Mock())
def test_open_method_raise_exception_if_not_new(self): """ Test that calling of open method on ticket with not "new" status raise an ValueError exception. """ ticket = Ticket() ticket.status = Ticket.STATUS.closed self.assertRaisesMessage( TicketIsNotNewError, 'Ticket not in status "New"', ticket.opening, Mock())
def new_tickets(requester, tipologies): tickets = [] for i in range(0, 2): t = Ticket() t.requester = requester t.status = Ticket.STATUS.new t.content = 'foo ' * 20 t.save() t.tipologies.add(*tipologies) t.initialize() tickets.append(t) return tickets