|
@ -8,18 +8,27 @@ class PricingTestCase(BaseTestCase): |
|
|
def test_anonymous(self): |
|
|
def test_anonymous(self): |
|
|
r = self.client.get("/pricing/") |
|
|
r = self.client.get("/pricing/") |
|
|
self.assertContains(r, "Unlimited Team Members", status_code=200) |
|
|
self.assertContains(r, "Unlimited Team Members", status_code=200) |
|
|
|
|
|
self.assertNotContains(r, "jumbotron") |
|
|
|
|
|
|
|
|
# A subscription object should have NOT been created |
|
|
# A subscription object should have NOT been created |
|
|
assert Subscription.objects.count() == 0 |
|
|
|
|
|
|
|
|
self.assertFalse(Subscription.objects.exists()) |
|
|
|
|
|
|
|
|
def test_authenticated(self): |
|
|
def test_authenticated(self): |
|
|
self.client.login(username="[email protected]", password="password") |
|
|
self.client.login(username="[email protected]", password="password") |
|
|
|
|
|
|
|
|
r = self.client.get("/pricing/") |
|
|
r = self.client.get("/pricing/") |
|
|
self.assertContains(r, "Unlimited Team Members", status_code=200) |
|
|
self.assertContains(r, "Unlimited Team Members", status_code=200) |
|
|
|
|
|
self.assertContains(r, "jumbotron") |
|
|
|
|
|
|
|
|
# A subscription object still should have NOT been created |
|
|
# A subscription object still should have NOT been created |
|
|
assert Subscription.objects.count() == 0 |
|
|
|
|
|
|
|
|
self.assertFalse(Subscription.objects.exists()) |
|
|
|
|
|
|
|
|
|
|
|
def test_authenticated_for_project(self): |
|
|
|
|
|
self.client.login(username="[email protected]", password="password") |
|
|
|
|
|
|
|
|
|
|
|
r = self.client.get("/projects/%s/pricing/" % self.project.code) |
|
|
|
|
|
self.assertContains(r, "Unlimited Team Members", status_code=200) |
|
|
|
|
|
self.assertContains(r, "jumbotron") |
|
|
|
|
|
|
|
|
@override_settings(USE_PAYMENTS=True) |
|
|
@override_settings(USE_PAYMENTS=True) |
|
|
def test_pricing_is_visible_for_all(self): |
|
|
def test_pricing_is_visible_for_all(self): |
|
@ -32,18 +41,9 @@ class PricingTestCase(BaseTestCase): |
|
|
def test_it_offers_to_switch(self): |
|
|
def test_it_offers_to_switch(self): |
|
|
self.client.login(username="[email protected]", password="password") |
|
|
self.client.login(username="[email protected]", password="password") |
|
|
|
|
|
|
|
|
r = self.client.get("/pricing/") |
|
|
|
|
|
|
|
|
r = self.client.get("/projects/%s/pricing/" % self.project.code) |
|
|
self.assertContains(r, "To manage billing for this project") |
|
|
self.assertContains(r, "To manage billing for this project") |
|
|
|
|
|
|
|
|
def test_it_handles_null_project(self): |
|
|
|
|
|
self.profile.current_project = None |
|
|
|
|
|
self.profile.save() |
|
|
|
|
|
|
|
|
|
|
|
self.client.login(username="[email protected]", password="password") |
|
|
|
|
|
|
|
|
|
|
|
r = self.client.get("/pricing/") |
|
|
|
|
|
self.assertContains(r, "Unlimited Team Members") |
|
|
|
|
|
|
|
|
|
|
|
def test_it_shows_active_plan(self): |
|
|
def test_it_shows_active_plan(self): |
|
|
self.sub = Subscription(user=self.alice) |
|
|
self.sub = Subscription(user=self.alice) |
|
|
self.sub.subscription_id = "test-id" |
|
|
self.sub.subscription_id = "test-id" |
|
@ -55,3 +55,6 @@ class PricingTestCase(BaseTestCase): |
|
|
|
|
|
|
|
|
r = self.client.get("/pricing/") |
|
|
r = self.client.get("/pricing/") |
|
|
self.assertContains(r, "Business ($20 / month)", status_code=200) |
|
|
self.assertContains(r, "Business ($20 / month)", status_code=200) |
|
|
|
|
|
|
|
|
|
|
|
r = self.client.get("/projects/%s/pricing/" % self.project.code) |
|
|
|
|
|
self.assertContains(r, "Business ($20 / month)", status_code=200) |