def test_save_update(self, update_object): department = Department() department.Id = 1 json = department.to_json() department.save(qb=self.qb_client) update_object.assert_called_once_with("Department", json)
def test_save_update_with_qb(self): with patch.object(self.qb_client, 'update_object') as update_object: department = Department() department.Id = 1 json = department.to_json() department.save(qb=self.qb_client) self.assertTrue(update_object.called)
def test_save_create(self, create_object): department = Department() department.save(qb=self.qb_client) create_object.assert_called_once_with("Department", department.to_json())