def test_update_ticket(self): args = dict(self.ticket_args, summary='test update ticket', labels='', assigned_to=self.ticket_args['assigned_to_id'] or '') for bad_key in ('ticket_num', 'assigned_to_id', 'created_date', 'reported_by', 'reported_by_id', '_id', 'votes_up', 'votes_down'): del args[bad_key] args['private'] = str(args['private']) ticket_view = self.api_post( '/rest/p/test/bugs/1/save', wrap_args='ticket_form', params=h.encode_keys(args)) assert ticket_view.status_int == 200, ticket_view.showbrowser() json = ticket_view.json['ticket'] assert int(json['ticket_num']) == 1 assert json['summary'] == 'test update ticket', json
def test_update_ticket(self): args = dict(self.ticket_args, summary='test update ticket', labels='', assigned_to=self.ticket_args['assigned_to_id'] or '') for bad_key in ('ticket_num', 'assigned_to_id', 'created_date', 'reported_by', 'reported_by_id', '_id', 'votes_up', 'votes_down', 'discussion_thread'): del args[bad_key] args['private'] = str(args['private']) args['discussion_disabled'] = str(args['discussion_disabled']) ticket_view = self.api_post( '/rest/p/test/bugs/1/save', wrap_args='ticket_form', params=h.encode_keys(args)) assert ticket_view.status_int == 200, ticket_view.showbrowser() json = ticket_view.json['ticket'] assert int(json['ticket_num']) == 1 assert json['summary'] == 'test update ticket', json
def test_encode_keys(): kw = h.encode_keys({u'foo': 5}) assert type(kw.keys()[0]) != unicode
def test_update_ticket(self): args = dict( self.ticket_args, summary="test update ticket", labels="", assigned_to=self.ticket_args["assigned_to_id"] or "", ) for bad_key in ("ticket_num", "assigned_to_id", "created_date", "reported_by", "reported_by_id", "_id"): del args[bad_key] args["private"] = str(args["private"]) ticket_view = self.api_post("/rest/p/test/bugs/1/save", wrap_args="ticket_form", **h.encode_keys(args)) assert ticket_view.status_int == 200, ticket_view.showbrowser() json = ticket_view.json["ticket"] assert int(json["ticket_num"]) == 1 assert json["summary"] == "test update ticket", json
def test_encode_keys(): kw = h.encode_keys({'foo': 5}) assert isinstance(list(kw.keys())[0], str)