{"action":"created","issue":{"url":"https://api.github.com/repos/kiwitcms/Kiwi/issues/346","repository_url":"https://api.github.com/repos/kiwitcms/Kiwi","labels_url":"https://api.github.com/repos/kiwitcms/Kiwi/issues/346/labels{/name}","comments_url":"https://api.github.com/repos/kiwitcms/Kiwi/issues/346/comments","events_url":"https://api.github.com/repos/kiwitcms/Kiwi/issues/346/events","html_url":"https://github.com/kiwitcms/Kiwi/issues/346","id":323487450,"node_id":"MDU6SXNzdWUzMjM0ODc0NTA=","number":346,"title":"Test Plan - Test cases cannot be added to existing test run / New test run cannot be created from test cases","user":{"login":"Prome88","id":25688732,"node_id":"MDQ6VXNlcjI1Njg4NzMy","avatar_url":"https://avatars3.githubusercontent.com/u/25688732?v=4","gravatar_id":"","url":"https://api.github.com/users/Prome88","html_url":"https://github.com/Prome88","followers_url":"https://api.github.com/users/Prome88/followers","following_url":"https://api.github.com/users/Prome88/following{/other_user}","gists_url":"https://api.github.com/users/Prome88/gists{/gist_id}","starred_url":"https://api.github.com/users/Prome88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Prome88/subscriptions","organizations_url":"https://api.github.com/users/Prome88/orgs","repos_url":"https://api.github.com/users/Prome88/repos","events_url":"https://api.github.com/users/Prome88/events{/privacy}","received_events_url":"https://api.github.com/users/Prome88/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-16T06:42:31Z","updated_at":"2018-08-31T20:48:29Z","closed_at":null,"author_association":"NONE","body":"### Description of problem\r\n\r\n- Test cases cannot be added to existing test run \r\n- New test run cannot be created from test cases\r\n\r\n### Component (web, API, etc)\r\nWeb\r\n\r\n### Version or commit hash (if applicable)\r\n4.1.4\r\n\r\n### How often reproducible\r\nAlways.\r\n\r\n### Steps to Reproduce\r\n\r\n1. Open test plan\r\n2. Select cases\r\n3. Click on Create new test run / Add to existing test run\r\n\r\n### Actual results\r\nInternal server error 500.\r\n\r\nNew test run:\r\n`ERROR:django.request:Internal Server Error: /run/new/\r\nTraceback (most recent call last):\r\nFile \"/venv/lib64/python3.5/site-packages/django/core/handlers/exception.py\", line 35, in inner\r\nresponse = get_response(request)\r\nFile \"/venv/lib64/python3.5/site-packages/django/core/handlers/base.py\", line 128, in _get_response\r\nresponse = self.process_exception_by_middleware(e, request)\r\nFile \"/venv/lib64/python3.5/site-packages/django/core/handlers/base.py\", line 126, in _get_response\r\nresponse = wrapped_callback(request, *callback_args, **callback_kwargs)\r\nFile \"/venv/lib64/python3.5/site-packages/django/views/decorators/http.py\", line 40, in inner\r\nreturn func(request, *args, **kwargs)\r\nFile \"/venv/lib64/python3.5/site-packages/django/contrib/auth/decorators.py\", line 21, in _wrapped_view\r\nreturn view_func(request, *args, **kwargs)\r\nFile \"/venv/lib64/python3.5/site-packages/tcms/testruns/views.py\", line 189, in new\r\n(tc.estimated_time for tc in tcs_values))\r\nFile \"/venv/lib64/python3.5/site-packages/django/db/models/query.py\", line 272, in __iter__\r\nself._fetch_all()\r\nFile \"/venv/lib64/python3.5/site-packages/django/db/models/query.py\", line 1179, in _fetch_all\r\nself._result_cache = list(self._iterable_class(self))\r\nFile \"/venv/lib64/python3.5/site-packages/django/db/models/query.py\", line 53, in __iter__\r\nresults = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)\r\nFile \"/venv/lib64/python3.5/site-packages/django/db/models/sql/compiler.py\", line 1054, in execute_sql\r\nsql, params = self.as_sql()\r\nFile \"/venv/lib64/python3.5/site-packages/django/db/models/sql/compiler.py\", line 447, in as_sql\r\nextra_select, order_by, group_by = self.pre_sql_setup()\r\nFile \"/venv/lib64/python3.5/site-packages/django/db/models/sql/compiler.py\", line 50, in pre_sql_setup\r\nself.setup_query()\r\nFile \"/venv/lib64/python3.5/site-packages/django/db/models/sql/compiler.py\", line 41, in setup_query\r\nself.select, self.klass_info, self.annotation_col_map = self.get_select()\r\nFile \"/venv/lib64/python3.5/site-packages/django/db/models/sql/compiler.py\", line 231, in get_select\r\nrelated_klass_infos = self.get_related_selections(select)\r\nFile \"/venv/lib64/python3.5/site-packages/django/db/models/sql/compiler.py\", line 795, in get_related_selections\r\nonly_load.get(field_model)):\r\nFile \"/venv/lib64/python3.5/site-packages/django/db/models/query_utils.py\", line 254, in select_related_descend\r\n(field.model._meta.object_name, field.name))\r\ndjango.db.models.query_utils.InvalidQuery: Field TestCase.default_tester cannot be both deferred and traversed using select_related at the same time.`\r\n\r\nAdd to existing test run:\r\n`ERROR:django.request:Internal Server Error: /plan/1/chooseruns/\r\nTraceback (most recent call last):\r\nFile \"/venv/lib64/python3.5/site-packages/django/core/handlers/exception.py\", line 35, in inner\r\nresponse = get_response(request)\r\nFile \"/venv/lib64/python3.5/site-packages/django/core/handlers/base.py\", line 128, in _get_response\r\nresponse = self.process_exception_by_middleware(e, request)\r\nFile \"/venv/lib64/python3.5/site-packages/django/core/handlers/base.py\", line 126, in _get_response\r\nresponse = wrapped_callback(request, *callback_args, **callback_kwargs)\r\nFile \"/venv/lib64/python3.5/site-packages/django/views/decorators/http.py\", line 40, in inner\r\nreturn func(request, *args, **kwargs)\r\nFile \"/venv/lib64/python3.5/site-packages/django/contrib/auth/decorators.py\", line 21, in _wrapped_view\r\nreturn view_func(request, *args, **kwargs)\r\nFile \"/venv/lib64/python3.5/site-packages/tcms/testplans/views.py\", line 366, in choose_run\r\ntest_plan = TestPlan.objects.get(pk=int(plan_id)).defer('product_version')\r\nAttributeError: 'TestPlan' object has no attribute 'defer'`\r\n\r\n\r\n### Expected results\r\nTest cases added to test run.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/kiwitcms/Kiwi/issues/comments/417785205","html_url":"https://github.com/kiwitcms/Kiwi/issues/346#issuecomment-417785205","issue_url":"https://api.github.com/repos/kiwitcms/Kiwi/issues/346","id":417785205,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzc4NTIwNQ==","user":{"login":"atodorov","id":1002300,"node_id":"MDQ6VXNlcjEwMDIzMDA=","avatar_url":"https://avatars3.githubusercontent.com/u/1002300?v=4","gravatar_id":"","url":"https://api.github.com/users/atodorov","html_url":"https://github.com/atodorov","followers_url":"https://api.github.com/users/atodorov/followers","following_url":"https://api.github.com/users/atodorov/following{/other_user}","gists_url":"https://api.github.com/users/atodorov/gists{/gist_id}","starred_url":"https://api.github.com/users/atodorov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atodorov/subscriptions","organizations_url":"https://api.github.com/users/atodorov/orgs","repos_url":"https://api.github.com/users/atodorov/repos","events_url":"https://api.github.com/users/atodorov/events{/privacy}","received_events_url":"https://api.github.com/users/atodorov/received_events","type":"User","site_admin":false},"created_at":"2018-08-31T20:48:29Z","updated_at":"2018-08-31T20:48:29Z","author_association":"MEMBER","body":"Note: this is probably fixed in 5.2 b/c I don't see the last line of the traceback. However I see a few more places where `.defer` is used and I want to check them out before closing this issue."}}
{"actor":{"display_login":"atodorov"}}