Ejemplo n.º 1
0
    def test_account_type(self):
        self.assert200(self.client.get(url_for('users.account_type')))

        Tier.create(
            name="Test tier",
            price=42,
            available=True,
            primary=False,
        )
        self.assert200(self.client.get(url_for('users.account_type')))
Ejemplo n.º 2
0
    def test_account_type(self):
        self.assert200(self.client.get(url_for('users.account_type')))

        Tier.create(
            name="Test tier",
            price=42,
            available=True,
            primary=False,
        )
        self.assert200(self.client.get(url_for('users.account_type')))
Ejemplo n.º 3
0
 def test_tier(self):
     t = Tier.create(
         name="Test tier",
         price=42,
         available=True,
         primary=False,
     )
     self.assert200(self.client.get(url_for('users.tier', tier_id=t.id)))
     self.assert404(self.client.get(url_for('users.tier', tier_id=t.id + 1)))
Ejemplo n.º 4
0
 def test_tier(self):
     t = Tier.create(
         name="Test tier",
         price=42,
         available=True,
         primary=False,
     )
     self.assert200(self.client.get(url_for('users.tier', tier_id=t.id)))
     self.assert404(self.client.get(url_for('users.tier',
                                            tier_id=t.id + 1)))
Ejemplo n.º 5
0
    def test_signup_commercial(self):
        resp = self.client.get(url_for('users.signup_commercial'))
        self.assertRedirects(resp, url_for('users.account_type'))

        unavailable_tier = Tier.create(
            name="Unavailable tier",
            price=42,
            available=False,
        )
        resp = self.client.get(url_for('users.signup_commercial', tier_id=unavailable_tier.id))
        self.assertRedirects(resp, url_for('users.account_type'))

        # With missing tier
        resp = self.client.get(url_for('users.signup_commercial', tier_id=unavailable_tier.id + 1))
        self.assertRedirects(resp, url_for('users.account_type'))
Ejemplo n.º 6
0
    def test_signup_commercial(self):
        resp = self.client.get(url_for('users.signup_commercial'))
        self.assertRedirects(resp, url_for('users.account_type'))

        unavailable_tier = Tier.create(
            name="Unavailable tier",
            price=42,
            available=False,
        )
        resp = self.client.get(
            url_for('users.signup_commercial', tier_id=unavailable_tier.id))
        self.assertRedirects(resp, url_for('users.account_type'))

        # With missing tier
        resp = self.client.get(
            url_for('users.signup_commercial',
                    tier_id=unavailable_tier.id + 1))
        self.assertRedirects(resp, url_for('users.account_type'))