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")
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")
def test_endpoint(self): plan = invoiced.Plan(self.client, "starter") self.assertEqual('/plans/starter', plan.endpoint())
def test_update_no_params(self): plan = invoiced.Plan(self.client, "starter") self.assertFalse(plan.save())