def test_purchasable_items(self): for purchase in PURCHASES_BY_UID.values(): if not isinstance(purchase, PermanentPurchase): continue self.account.permanent_purchases.insert(purchase.purchase_type) self.account.save() existed_uids = PURCHASES_BY_UID.keys() existed_uids.remove(purchase.uid) if purchase.purchase_type.is_INFINIT_SUBSCRIPTION: existed_uids = [uid for uid in existed_uids if not uid.startswith('subscription-')] self.check_html_ok(self.request_html(self.page_url), texts=[('pgf-no-goods-message', 0), (purchase.uid, 0)] + existed_uids ) self.account.permanent_purchases._data = set() self.account.save()
def test_purchasable_items(self): for purchase in PURCHASES_BY_UID.values(): if not isinstance(purchase, PermanentPurchase): continue self.account.permanent_purchases.insert(purchase.purchase_type) self.account.save() existed_uids = PURCHASES_BY_UID.keys() existed_uids.remove(purchase.uid) if purchase.purchase_type.is_INFINIT_SUBSCRIPTION: existed_uids = [ uid for uid in existed_uids if not uid.startswith('subscription-') ] self.check_html_ok(self.request_html(self.page_url), texts=[('pgf-no-goods-message', 0), (purchase.uid, 0)] + existed_uids) self.account.permanent_purchases._data = set() self.account.save()
def setUp(self): super(BuyRequestesTests, self).setUp() self.purchase = PURCHASES_BY_UID.values()[0]