def get_tickets(self, query_string): """Wrapper around ``get_dicts()`` that returns ``Ticket`` instances. :param query_string: Starts with a slash, part of the URL between the domain and the parameters (before the ?). """ for ticket_dict in self.get_dicts(query_string): yield ticket.factory(ticket_dict)
def test_ticket_factory_alt(self): t = ticket.factory({ "ticket": "123", "_reporter": "douche", }) self.assertEquals(t.id, 123) self.assertEquals(t.reporter, "douche")
def test_ticket_factory(self): t = ticket.factory({ "id": "245", "summary": "meh", "reporter": "douche", "description": "clean all the things", }) self.assertEquals(t.id, 245) self.assertEquals(t.summary, "meh") self.assertEquals(t.reporter, "douche") self.assertEquals(t.description, "clean all the things")