def setUp(self): super().setUp() # We can't test if query conditions actualy return the correct objects # so mock any Synchronizers with custom query conditions. mocks.create_mock_call( 'djautotask.sync.TicketSynchronizer._get_query_conditions', None) fixture_utils.init_statuses()
def setUp(self): super().setUp() self.synchronizer = sync.TicketSynchronizer() fixture_utils.init_statuses() fixture_utils.init_resources() fixture_utils.init_tickets()
def setUp(self): super().setUp() mocks.init_api_connection(Wrapper) fixture_utils.init_resources() fixture_utils.init_statuses() fixture_utils.init_priorities() fixture_utils.init_projects() fixture_utils.init_tasks()
def setUp(self): super().setUp() fixture_utils.init_service_call_statuses() fixture_utils.init_account_types() fixture_utils.init_accounts() fixture_utils.init_service_calls() fixture_utils.init_statuses() fixture_utils.init_projects() fixture_utils.init_tasks()
def setUp(self): super().setUp() fixture_utils.init_service_call_statuses() fixture_utils.init_resources() fixture_utils.init_account_types() fixture_utils.init_accounts() fixture_utils.init_service_calls() fixture_utils.init_statuses() fixture_utils.init_tickets()
def test_add(self): self.assertEqual(Ticket.objects.count(), 0) fixture_utils.init_statuses() _, patch = mocks.service_api_get_ticket_call(fixtures.API_TICKET_BY_ID) _, _checklist_patch = mocks.create_mock_call( "djautotask.sync_rest.TicketChecklistItemsSynchronizer.sync_items", None) self._test_synced(fixtures.API_TICKET_BY_ID['item']) patch.stop() _checklist_patch.stop()
def test_update(self): fixture_utils.init_statuses() fixture_utils.init_tickets() self.assertEqual(Ticket.objects.count(), 1) # Change the description of the local record to make our test # meaningful. t = Ticket.objects.get(id=7688) t.description = 'foobar' t.save() _, patch = mocks.service_api_get_ticket_call(fixtures.API_TICKET_BY_ID) _, _checklist_patch = mocks.create_mock_call( "djautotask.sync_rest.TicketChecklistItemsSynchronizer.sync_items", None) self._test_synced(fixtures.API_TICKET_BY_ID['item']) patch.stop() _checklist_patch.stop()
def setUp(self): super().setUp() fixture_utils.init_statuses()