예제 #1
0
 def test_remove_item_from_cart(self):
     username = '******'
     item_id = 1
     quantity = 20
     ShoppingCartDB.add_item_shopping_cart(
         ShoppingCartDB.ShoppingCartItem(username, item_id, quantity, ""))
     ShoppingCartDB.remove_item_shopping_cart(username, item_id)
     cart_items = ShoppingCartDB.get_cart_items(username)
     self.assertEqual(len(cart_items), 0)
예제 #2
0
def remove_item_shopping_cart(username, item_id):
    if username is not None and item_id is not None:
        user = RegisteredUsers.get_user(username)
        if user is not False:
            return ShoppingCartDB.remove_item_shopping_cart(username, item_id)