Beispiel #1
0
 def test_delete(self, create_instance):
     prod_dao = ProductDao()
     new_prod = prod_dao.save(create_instance)
     result = prod_dao.read_by_id(new_prod.id)
     prod_dao.delete(result)
     result = prod_dao.read_by_id(new_prod.id)
     assert result is None
Beispiel #2
0
 def test_read_by_id(self, create_instance):
     product = create_instance
     prod_dao = ProductDao()
     new_prod = prod_dao.save(product)
     result = prod_dao.read_by_id(new_prod.id)
     assert isinstance(result, Product)
     assert new_prod.name == result.name
     assert new_prod.price == result.price
     assert new_prod.description == result.description
     prod_dao.delete(new_prod)