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_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())
 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())