示例#1
0
    def test_delete(self):
        responses.add('DELETE',
                      'https://api.invoiced.com/plans/starter',
                      status=200,
                      json={
                          "id": "starter",
                          "name": "Pro"
                      })

        plan = invoiced.Plan(self.client, "starter")
        self.assertTrue(plan.delete())
        self.assertEqual(plan.name, "Pro")
示例#2
0
    def test_update(self):
        responses.add('PATCH',
                      'https://api.invoiced.com/plans/starter',
                      status=200,
                      json={
                          "id": "starter",
                          "name": "Pro"
                      })

        plan = invoiced.Plan(self.client, "starter")
        plan.name = "Pro"
        self.assertTrue(plan.save())

        self.assertEqual(plan.name, "Pro")
示例#3
0
 def test_endpoint(self):
     plan = invoiced.Plan(self.client, "starter")
     self.assertEqual('/plans/starter', plan.endpoint())
示例#4
0
 def test_update_no_params(self):
     plan = invoiced.Plan(self.client, "starter")
     self.assertFalse(plan.save())