def test_edit_cart_link_visible_when_cart_has_items(self, browser):
        browser.login().open()
        self.assertFalse(cartportlet.edit_cart_link(),
                         '"Edit cart" link should not be visible yet.')

        item = create(Builder('shop item'))
        browser.visit(item)
        shopitem.add_to_cart()
        self.assertTrue(cartportlet.edit_cart_link(),
                        '"Edit cart" link should now be visible.')
    def test_edit_cart_link_visible_when_cart_has_items(self, browser):
        browser.login().open()
        self.assertFalse(cartportlet.edit_cart_link(),
                         '"Edit cart" link should not be visible yet.')

        item = create(Builder('shop item'))
        browser.visit(item)
        shopitem.add_to_cart()
        self.assertTrue(cartportlet.edit_cart_link(),
                        '"Edit cart" link should now be visible.')
    def test_adding_items_to_cart(self, browser):
        browser.login().open()
        self.assertTrue(cartportlet.is_visible(), 'Cart portlet should be visible.')
        self.assertTrue(cartportlet.is_empty(), 'Cart portlet should be empty.')

        item = create(Builder('shop item')
                      .titled('A pair of socks'))
        browser.visit(item)
        shopitem.add_to_cart()
        self.assertEquals(['A pair of socks'], cartportlet.items())
    def test_adding_items_to_cart(self, browser):
        browser.login().open()
        self.assertTrue(cartportlet.is_visible(),
                        'Cart portlet should be visible.')
        self.assertTrue(cartportlet.is_empty(),
                        'Cart portlet should be empty.')

        item = create(Builder('shop item').titled('A pair of socks'))
        browser.visit(item)
        shopitem.add_to_cart()
        self.assertEquals(['A pair of socks'], cartportlet.items())
Exemple #5
0
def add_item_to_cart(item, amount=1):
    browser.visit(item)
    shopitem.add_to_cart(amount=amount)
 def test_order_link_opens_checkout_wizard(self, browser):
     item = create(Builder('shop item'))
     browser.login().visit(item)
     shopitem.add_to_cart()
     cartportlet.order_link().click()
     self.assertEquals('checkout-wizard', plone.view())
 def test_edit_cart_link_opens_edit_cart_view(self, browser):
     item = create(Builder('shop item'))
     browser.login().visit(item)
     shopitem.add_to_cart()
     cartportlet.edit_cart_link().click()
     self.assertEquals('cart_edit', plone.view())
Exemple #8
0
def add_item_to_cart(item, amount=1):
    browser.visit(item)
    shopitem.add_to_cart(amount=amount)
 def test_order_link_opens_checkout_wizard(self, browser):
     item = create(Builder('shop item'))
     browser.login().visit(item)
     shopitem.add_to_cart()
     cartportlet.order_link().click()
     self.assertEquals('checkout-wizard', plone.view())
 def test_edit_cart_link_opens_edit_cart_view(self, browser):
     item = create(Builder('shop item'))
     browser.login().visit(item)
     shopitem.add_to_cart()
     cartportlet.edit_cart_link().click()
     self.assertEquals('cart_edit', plone.view())