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')))
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)))
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'))
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'))