0
0
Fork 0
mirror of https://github.com/healthchecks/healthchecks.git synced 2025-04-07 14:15:34 +00:00
healthchecks_healthchecks/hc/payments/tests/test_billing.py
2018-01-09 16:45:38 +02:00

16 lines
506 B
Python

from mock import patch
from hc.payments.models import Subscription
from hc.test import BaseTestCase
class SetPlanTestCase(BaseTestCase):
@patch("hc.payments.models.braintree")
def test_it_saves_send_invoices_flag(self, mock):
self.client.login(username="alice@example.org", password="password")
form = {"save_send_invoices": True}
self.client.post("/accounts/profile/billing/", form)
sub = Subscription.objects.get()
self.assertFalse(sub.send_invoices)