~vila/uci-engine/nova-failure

« back to all changes in this revision

Viewing changes to ticket_system/ticket/tests/test_write_api.py

  • Committer: Ubuntu CI Bot
  • Author(s): Celso Providelo
  • Date: 2014-11-15 00:10:07 UTC
  • mfrom: (885.8.1 ts-hydrate-subtickets)
  • Revision ID: ubuntu_ci_bot-20141115001007-u685wxtrnc0d9mcn
Fix TicketResource.subtickets *hydration* cycle to fill omitted fields in the bundle so PATCH will not override them with their default values. [r=Ursula Junque, PS Jenkins bot]

Show diffs side-by-side

added added

removed removed

Lines of Context:
293
293
        # Create a matching `SourcePackage` and `SubTicket`.
294
294
        sp = SourcePackage.objects.create(name='foo')
295
295
        subticket = self.ticket.subticket_set.create(
296
 
            sourcepackage=sp, assignee='boing@boing.com')
 
296
            sourcepackage=sp, assignee='boing@boing.com',
 
297
            current_workflow_step=TicketWorkflowStep.IMAGE_BUILDING,
 
298
            status=TicketWorkflowStepStatus.INPROGRESS)
297
299
 
298
300
        self.patch(resource=self.detail_url, params=params)
299
301
 
304
306
        self.assertEqual(old, subticket)
305
307
        self.assertEqual('foo@bar.com', old.assignee)
306
308
        self.assertEqual('Atomic Patched Ticket bar', unicode(new))
 
309
        # The existing `SubTicket` fields ommitted in the PATCH operation
 
310
        # were preserved.
 
311
        self.assertEqual(
 
312
            TicketWorkflowStep.IMAGE_BUILDING.value,
 
313
            old.current_workflow_step)
 
314
        self.assertEqual(
 
315
            TicketWorkflowStepStatus.INPROGRESS.value, old.status)
307
316
 
308
317
    def test_post_ticket_citrain_overlay(self):
309
318
        # `Ticket` creation supports adding CI-Train extra fields (via