{"action":"opened","issue":{"url":"https://api.github.com/repos/frlp-utn-is-2018/orderingg/issues/77","repository_url":"https://api.github.com/repos/frlp-utn-is-2018/orderingg","labels_url":"https://api.github.com/repos/frlp-utn-is-2018/orderingg/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/frlp-utn-is-2018/orderingg/issues/77/comments","events_url":"https://api.github.com/repos/frlp-utn-is-2018/orderingg/issues/77/events","html_url":"https://github.com/frlp-utn-is-2018/orderingg/issues/77","id":328860635,"node_id":"MDU6SXNzdWUzMjg4NjA2MzU=","number":77,"title":"Test de integración - Prod con cantidad negativa","user":{"login":"Alexissiminkowich","id":38230123,"node_id":"MDQ6VXNlcjM4MjMwMTIz","avatar_url":"https://avatars2.githubusercontent.com/u/38230123?v=4","gravatar_id":"","url":"https://api.github.com/users/Alexissiminkowich","html_url":"https://github.com/Alexissiminkowich","followers_url":"https://api.github.com/users/Alexissiminkowich/followers","following_url":"https://api.github.com/users/Alexissiminkowich/following{/other_user}","gists_url":"https://api.github.com/users/Alexissiminkowich/gists{/gist_id}","starred_url":"https://api.github.com/users/Alexissiminkowich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alexissiminkowich/subscriptions","organizations_url":"https://api.github.com/users/Alexissiminkowich/orgs","repos_url":"https://api.github.com/users/Alexissiminkowich/repos","events_url":"https://api.github.com/users/Alexissiminkowich/events{/privacy}","received_events_url":"https://api.github.com/users/Alexissiminkowich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-03T20:45:43Z","updated_at":"2018-06-03T20:45:43Z","closed_at":null,"author_association":"NONE","body":"Buenas tardes\r\n\r\nEstoy trabajando con el punto 1.c de mi actividad, el de cargar un prod con cantidad negativa.\r\nCorre bien y llega al assert y da error, osea que deja cargar con cantidad negativa, le falta algo?\r\n\r\nLogre lo siguiente:\r\n\r\ndef test_solved_BUG_of_negative_quantity(self):\r\n        # Inicio la Orden y cargo en la BD\r\n        o = Order(id=1)\r\n        db.session.add(o)\r\n\r\n        # Inicio el Producto y cargo en la BD\r\n        p = Product(id=1, name = 'Armario', price = 800)\r\n        db.session.add(p)\r\n\r\n        db.session.commit()\r\n\r\n        #Abro el browser con la URL\r\n        driver = self.driver\r\n        driver.get(self.baseURL)\r\n        \r\n        #Clickeo en el boton para abrir el modal\r\n        driver.find_element_by_xpath(\"/html/body/main/div[1]/div/button\").click()\r\n        \r\n        #Selecciono el producto\r\n        select_prod = driver.find_element_by_id('select-prod')\r\n        select_prod.click()\r\n        time.sleep(2)\r\n        selecciono = driver.find_element_by_xpath('//*[@id=\"select-prod\"]/option[2]')\r\n        selecciono.click()\r\n        time.sleep(2)\r\n\r\n        #Asigno cantidad -5 al campo cantidad\r\n        cant = driver.find_element_by_id('quantity')\r\n        cant.clear()\r\n        cant.send_keys('-5')\r\n        time.sleep(2)\r\n\r\n        #Corroboro que se cargo el producto con cantidad negativa\r\n        guardar = driver.find_element_by_id('save-button')\r\n        guardar.click()\r\n        prod = Product.query.all()\r\n        print(prod)\r\n        self.assertEqual(len(prod), 0, \"Se pudo ingresar un producto con cantidad negativa\")\r\n\r\nEl resultado me da:\r\n\r\nEquipo@Equipo-PC MINGW32 ~/Desktop/ING DE SOFTWARE/orderingg (dev)\r\n$ pytest\r\n============================= test session starts =============================\r\nplatform win32 -- Python 3.4.0, pytest-3.5.1, py-1.5.3, pluggy-0.6.0\r\nrootdir: C:\\Users\\Equipo\\Desktop\\ING DE SOFTWARE\\orderingg, inifile:\r\ncollected 5 items\r\n\r\ntest\\test_e2e.py F                                                       [ 20%]\r\ntest\\test_unit.py ....                                                   [100%]\r\n\r\n================================== FAILURES ===================================\r\n________________ Ordering.test_solved_BUG_of_negative_quantity ________________\r\n\r\nself = <test.test_e2e.Ordering testMethod=test_solved_BUG_of_negative_quantity>\r\n\r\n    def test_solved_BUG_of_negative_quantity(self):\r\n        # Inicio la Orden y cargo en la BD\r\n        o = Order(id=1)\r\n        db.session.add(o)\r\n\r\n        # Inicio el Producto y cargo en la BD\r\n        p = Product(id=1, name = 'Armario', price = 800)\r\n        db.session.add(p)\r\n\r\n        db.session.commit()\r\n\r\n        #Abro el browser con la URL\r\n        driver = self.driver\r\n        driver.get(self.baseURL)\r\n\r\n        #Clickeo en el boton para abrir el modal\r\n        driver.find_element_by_xpath(\"/html/body/main/div[1]/div/button\").click(                         )\r\n\r\n        #Selecciono el producto\r\n        select_prod = driver.find_element_by_id('select-prod')\r\n        select_prod.click()\r\n        time.sleep(2)\r\n        selecciono = driver.find_element_by_xpath('//*[@id=\"select-prod\"]/option                         [2]')\r\n        selecciono.click()\r\n        time.sleep(2)\r\n\r\n        #Asigno cantidad -5 al campo cantidad\r\n        cant = driver.find_element_by_id('quantity')\r\n        cant.clear()\r\n        cant.send_keys('-5')\r\n        time.sleep(2)\r\n\r\n        #Corroboro que se cargo el producto con cantidad negativa\r\n        guardar = driver.find_element_by_id('save-button')\r\n        guardar.click()\r\n        prod = Product.query.all()\r\n        print(prod)\r\n>       self.assertEqual(len(prod), 0, \"Se pudo ingresar un producto con cantida                         d negativa\")\r\nE       AssertionError: 1 != 0 : Se pudo ingresar un producto con cantidad negat                         iva\r\n\r\ntest\\test_e2e.py:85: AssertionError\r\n---------------------------- Captured stdout call -----------------------------\r\n[Armario]\r\n------------------------------ Captured log call ------------------------------\r\n_internal.py                88 ERROR    Error on request:\r\nTraceback (most recent call last):\r\n  File \"C:\\Python34\\lib\\site-packages\\werkzeug\\serving.py\", line 270, in run_wsg                         i\r\n    execute(self.server.app)\r\n  File \"C:\\Python34\\lib\\site-packages\\werkzeug\\serving.py\", line 258, in execute\r\n    application_iter = app(environ, start_response)\r\n  File \"C:\\Python34\\lib\\site-packages\\flask\\app.py\", line 1997, in __call__\r\n    return self.wsgi_app(environ, start_response)\r\n  File \"C:\\Python34\\lib\\site-packages\\flask\\app.py\", line 1985, in wsgi_app\r\n    response = self.handle_exception(e)\r\n  File \"C:\\Python34\\lib\\site-packages\\flask\\app.py\", line 1540, in handle_except                         ion\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"C:\\Python34\\lib\\site-packages\\flask\\_compat.py\", line 33, in reraise\r\n    raise value\r\n  File \"C:\\Python34\\lib\\site-packages\\flask\\app.py\", line 1982, in wsgi_app\r\n    response = self.full_dispatch_request()\r\n  File \"C:\\Python34\\lib\\site-packages\\flask\\app.py\", line 1614, in full_dispatch                         _request\r\n    rv = self.handle_user_exception(e)\r\n  File \"C:\\Python34\\lib\\site-packages\\flask\\app.py\", line 1517, in handle_user_e                         xception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"C:\\Python34\\lib\\site-packages\\flask\\_compat.py\", line 33, in reraise\r\n    raise value\r\n  File \"C:\\Python34\\lib\\site-packages\\flask\\app.py\", line 1612, in full_dispatch                         _request\r\n    rv = self.dispatch_request()\r\n  File \"C:\\Python34\\lib\\site-packages\\flask\\app.py\", line 1598, in dispatch_requ                         est\r\n    return self.view_functions[rule.endpoint](**req.view_args)\r\n  File \"C:\\Users\\Equipo\\Desktop\\ING DE SOFTWARE\\orderingg\\app\\routes.py\", line 6                         1, in addProductToOrder\r\n    order = Order.query.get(pk)\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\orm\\query.py\", line 882, in get\r\n    ident, loading.load_on_pk_identity)\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\orm\\query.py\", line 952, in _ge                         t_impl\r\n    return db_load_fn(self, primary_key_identity)\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\orm\\loading.py\", line 247, in l                         oad_on_pk_identity\r\n    return q.one()\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\orm\\query.py\", line 2884, in on                         e\r\n    ret = self.one_or_none()\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\orm\\query.py\", line 2854, in on                         e_or_none\r\n    ret = list(self)\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\orm\\query.py\", line 2925, in __                         iter__\r\n    return self._execute_and_instances(context)\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\orm\\query.py\", line 2948, in _e                         xecute_and_instances\r\n    result = conn.execute(querycontext.statement, self._params)\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 948, in e                         xecute\r\n    return meth(self, multiparams, params)\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\sql\\elements.py\", line 269, in                          _execute_on_connection\r\n    return connection._execute_clauseelement(self, multiparams, params)\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 1060, in                          _execute_clauseelement\r\n    compiled_sql, distilled_params\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 1200, in                          _execute_context\r\n    context)\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 1413, in                          _handle_dbapi_exception\r\n    exc_info\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\util\\compat.py\", line 203, in r                         aise_from_cause\r\n    reraise(type(exception), exception, tb=exc_tb, cause=cause)\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\util\\compat.py\", line 186, in r                         eraise\r\n    raise value.with_traceback(tb)\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 1193, in                          _execute_context\r\n    context)\r\n  File \"C:\\Python34\\lib\\site-packages\\sqlalchemy\\engine\\default.py\", line 507, i                         n do_execute\r\n    cursor.execute(statement, parameters)\r\nsqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: order                          [SQL: 'SELECT \"order\".id AS order_id \\nFROM \"order\" \\nWHERE \"order\".id = ?'] [p                         arameters: ('1',)] (Background on this error at: http://sqlalche.me/e/e3q8)\r\n===================== 1 failed, 4 passed in 27.54 seconds =====================\r\n"}}
{"actor":{"display_login":"Alexissiminkowich"}}