forked from GithubBackups/healthchecks
Fix tests
This commit is contained in:
parent
0cf4c13f00
commit
d1c07d89a6
@ -1,3 +1,5 @@
|
|||||||
|
from django.test import override_settings
|
||||||
|
|
||||||
from hc.payments.models import Subscription
|
from hc.payments.models import Subscription
|
||||||
from hc.test import BaseTestCase
|
from hc.test import BaseTestCase
|
||||||
|
|
||||||
@ -20,7 +22,9 @@ class PricingTestCase(BaseTestCase):
|
|||||||
# A subscription object still should have NOT been created
|
# A subscription object still should have NOT been created
|
||||||
assert Subscription.objects.count() == 0
|
assert Subscription.objects.count() == 0
|
||||||
|
|
||||||
|
@override_settings(USE_PAYMENTS=True)
|
||||||
def test_pricing_is_hidden_for_team_members(self):
|
def test_pricing_is_hidden_for_team_members(self):
|
||||||
|
|
||||||
self.client.login(username="bob@example.org", password="password")
|
self.client.login(username="bob@example.org", password="password")
|
||||||
|
|
||||||
r = self.client.get("/about/")
|
r = self.client.get("/about/")
|
||||||
@ -28,6 +32,7 @@ class PricingTestCase(BaseTestCase):
|
|||||||
# Alice's team, but is not its owner.
|
# Alice's team, but is not its owner.
|
||||||
self.assertNotContains(r, "Pricing")
|
self.assertNotContains(r, "Pricing")
|
||||||
|
|
||||||
|
@override_settings(USE_PAYMENTS=True)
|
||||||
def test_pricing_is_visible_for_team_owners(self):
|
def test_pricing_is_visible_for_team_owners(self):
|
||||||
self.client.login(username="alice@example.org", password="password")
|
self.client.login(username="alice@example.org", password="password")
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ from django.http import (HttpResponseBadRequest, HttpResponseForbidden,
|
|||||||
JsonResponse)
|
JsonResponse)
|
||||||
from django.shortcuts import redirect, render
|
from django.shortcuts import redirect, render
|
||||||
from django.views.decorators.http import require_POST
|
from django.views.decorators.http import require_POST
|
||||||
from hc.accounts.models import Profile
|
|
||||||
|
|
||||||
from .models import Subscription
|
from .models import Subscription
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user