Ejemplo n.º 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)
Ejemplo n.º 2
0
    def test_save_update(self, update_object):
        department = Department()
        department.Id = 1
        json = department.to_json()

        department.save()
        update_object.assert_called_once_with("Department", json)
Ejemplo n.º 3
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)
Ejemplo n.º 4
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)
Ejemplo n.º 5
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())
Ejemplo n.º 6
0
 def test_save_create(self, create_object):
     department = Department()
     department.save()
     create_object.assert_called_once_with("Department", department.to_json())