Beispiel #1
0
 def test_add_new_product(self):  #ok
     user1 = User("amir", 2)
     user1.identifier = 0
     store1 = Store("ramiLevi", 0, "123123", None, None)
     store1.supervisor = 1
     Ecommerce.get_instance().stores = [store1]
     user1.state = State.STORE_OWNER
     self.assertTrue(
         user1.add_new_product(0, "chocholate", 5, "Food",
                               ['Food', 'Sweet']), "need return True")
Beispiel #2
0
 def test_remove_from_cart(self):  #ok
     user1 = User("amir", 32)
     user1.identifier = 1
     user1.state = State.STORE_OWNER
     product1 = Product('chocholate', 'Food', ['Food', 'Sweet'], 10)
     product1.catalog_number = 1
     store1 = Store("ramiLevi", 0, "123123", None, None)
     store1.store_number = 0
     store1.supervisor = 1
     store1.add_new_product(product1)
     store1.owners = [user1.identifier]
     Ecommerce.get_instance().stores = [store1]
     self.assertTrue(user1.remove_product(0, 1).val, "need return True")
     self.assertFalse(user1.remove_product(0, 1).val, "need return False")