def test_update(self):
        """Function defined to test paystackapi plan update."""
        httpretty.register_uri(
            httpretty.PUT,
            "https://api.paystack.co/plan/78",
            content_type='text/json',
            body='{"status": true, "contributors": true}',
            status=201,
        )

        response = Plan.update(plan_id=78, interval="monthly", amount=70000)
        self.assertEqual(response['status'], True)
Esempio n. 2
0
    def test_get(self):
        """Function defined to test Plan get method."""
        httpretty.register_uri(
            httpretty.GET,
            self.endpoint_url("/plan/78"),
            content_type='text/json',
            body='{"status": true, "contributors": true}',
            status=201,
        )

        response = Plan.get(plan_id=78)
        self.assertEqual(response['status'], True)
    def test_list(self):
        """Function defined to test paystackapi plan list method."""
        httpretty.register_uri(
            httpretty.GET,
            "https://api.paystack.co/plan",
            content_type='text/json',
            body='{"status": true, "contributors": true}',
            status=201,
        )

        response = Plan.list()
        self.assertEqual(response['status'], True)
Esempio n. 4
0
    def test_update(self):
        """Function defined to test paystackapi plan update."""
        httpretty.register_uri(
            httpretty.PUT,
            "https://api.paystack.co/plan/78",
            content_type='text/json',
            body='{"status": true, "contributors": true}',
            status=201,
        )

        response = Plan.update(plan_id=78, interval="monthly", amount=70000)
        self.assertEqual(response['status'], True)
Esempio n. 5
0
    def test_list(self):
        """Function defined to test paystackapi plan list method."""
        httpretty.register_uri(
            httpretty.GET,
            "https://api.paystack.co/plan",
            content_type='text/json',
            body='{"status": true, "contributors": true}',
            status=201,
        )

        response = Plan.list()
        self.assertEqual(response['status'], True)
Esempio n. 6
0
    def test_list(self):
        """Method defined to test paystackapi plan list."""
        httpretty.register_uri(
            httpretty.GET,
            self.endpoint_url("/plan"),
            content_type='text/json',
            body='{"status": true, "contributors": true}',
            status=201,
        )

        response = Plan.list()
        self.assertEqual(response['status'], True)
Esempio n. 7
0
    def test_create(self):
        """Method defined to test plan creation."""
        httpretty.register_uri(
            httpretty.POST,
            "https://api.paystack.co/plan",
            content_type='text/json',
            body='{"status": true, "contributors": true}',
            status=201,
        )

        response = Plan.create(
            name="John Doe", description="Payment plan for awesome people contributions",
            amount=50000, interval="daily", send_invoices=True, )
        self.assertTrue(response['status'])
Esempio n. 8
0
    def test_create(self):
        """Method defined to test plan creation."""
        httpretty.register_uri(
            httpretty.POST,
            self.endpoint_url("/plan"),
            content_type='text/json',
            body='{"status": true, "contributors": true}',
            status=201,
        )

        response = Plan.create(
            name="John Doe", description="Payment plan for awesome people contributions",
            amount=50000, interval="daily", send_invoices=True, )
        self.assertTrue(response['status'])