예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
 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())