Error when remove tag from a plan's cases #174

Closed
tkdchen opened this Issue Apr 9, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@tkdchen
Member

tkdchen commented Apr 9, 2017

Steps

  1. Open a plan and go to Cases tab
  2. Select menu on top of case list, Tag -> Remove Tag
Internal Server Error: /cases/tag/
Traceback (most recent call last):
  File "/home/vagrant/nitrate-env/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/code/tcms/testcases/views.py", line 1700, in tag
    form.populate(case_ids=tcs)
  File "/code/tcms/testcases/forms.py", line 626, in populate
    testcase__in=case_ids).order_by('name').distinct()
  File "/home/vagrant/nitrate-env/lib/python2.7/site-packages/django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/vagrant/nitrate-env/lib/python2.7/site-packages/django/db/models/query.py", line 679, in filter
    return self._filter_or_exclude(False, *args, **kwargs)
  File "/home/vagrant/nitrate-env/lib/python2.7/site-packages/django/db/models/query.py", line 697, in _filter_or_exclude
    clone.query.add_q(Q(*args, **kwargs))
  File "/home/vagrant/nitrate-env/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1310, in add_q
    clause, require_inner = self._add_q(where_part, self.used_aliases)
  File "/home/vagrant/nitrate-env/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1338, in _add_q
    allow_joins=allow_joins, split_subq=split_subq,
  File "/home/vagrant/nitrate-env/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1150, in build_filter
    lookups, parts, reffed_expression = self.solve_lookup_type(arg)
  File "/home/vagrant/nitrate-env/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1036, in solve_lookup_type
    _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta())
  File "/home/vagrant/nitrate-env/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1397, in names_to_path
    "Choices are: %s" % (name, ", ".join(available)))
FieldError: Cannot resolve keyword 'testcase' into field. Choices are: cases, id, name, testcasetag, testplan, testplantag, testrun, testruntag
[09/Apr/2017 11:13:45] "POST /cases/tag/ HTTP/1.1" 500 18058

@tkdchen tkdchen added the bug label Apr 9, 2017

@tkdchen tkdchen added this to the 4.1 milestone Apr 9, 2017

atodorov added a commit to MrSenko/Nitrate that referenced this issue Apr 14, 2017

atodorov added a commit to MrSenko/Nitrate that referenced this issue Apr 14, 2017

atodorov added a commit to MrSenko/Nitrate that referenced this issue Apr 14, 2017

Fix traceback when removing test case tags. Fix #174
also add a basic test for it!

atodorov added a commit to MrSenko/Nitrate that referenced this issue Apr 16, 2017

Fix adding tags to test cases in TP
removal of tags bug is #174 which is fixed in PR #177

Signed-off-by: Mr. Senko <atodorov@mrsenko.com>

atodorov added a commit to MrSenko/Nitrate that referenced this issue Apr 19, 2017

Fix tags search and hint while adding tags to test cases in TP
How to reproduce:
- Open a Test Plan
- Go to Cases tab
- Select few test cases
- click Tag -> Add Tag button
- start typing tag name
- if there are tags which match the text they will be shown
  ad a drop-down hint. This was previously raising an exception.

Also simplified the strip_parameters() function which is
used internally and made minor updates to the template and
JavaScript files to match the backend changes and model field names.

Note:
Removal of tags bug is #174 which is fixed in PR #177

Signed-off-by: Mr. Senko <atodorov@mrsenko.com>

atodorov added a commit to MrSenko/Nitrate that referenced this issue May 1, 2017

atodorov added a commit to MrSenko/Nitrate that referenced this issue May 1, 2017

Fix tags search and hint while adding tags to test cases in TP
How to reproduce:
- Open a Test Plan
- Go to Cases tab
- Select few test cases
- click Tag -> Add Tag button
- start typing tag name
- if there are tags which match the text they will be shown
  ad a drop-down hint. This was previously raising an exception.

Also simplified the strip_parameters() function which is
used internally and made minor updates to the template and
JavaScript files to match the backend changes and model field names.

Note:
Removal of tags bug is #174 which is fixed in PR #177

Signed-off-by: Mr. Senko <atodorov@mrsenko.com>

atodorov added a commit to MrSenko/Nitrate that referenced this issue May 1, 2017

Fix traceback when removing test case tags and add test for it
Fix #174

Signed-off-by: Mr. Senko <atodorov@mrsenko.com>

atodorov added a commit to MrSenko/Nitrate that referenced this issue May 1, 2017

Fix traceback when removing test case tags and add test for it
Fix #174

Signed-off-by: Mr. Senko <atodorov@mrsenko.com>

@tkdchen tkdchen closed this in #177 May 1, 2017

tkdchen added a commit that referenced this issue May 1, 2017

Fix traceback when removing test case tags and add test for it
Fix #174

Signed-off-by: Mr. Senko <atodorov@mrsenko.com>

@tkdchen tkdchen modified the milestones: 4.0, 4.1 May 1, 2017

atodorov added a commit to MrSenko/Nitrate that referenced this issue May 12, 2017

Fix tags search and hint while adding tags to test cases in TP
How to reproduce:
- Open a Test Plan
- Go to Cases tab
- Select few test cases
- click Tag -> Add Tag button
- start typing tag name
- if there are tags which match the text they will be shown
  ad a drop-down hint. This was previously raising an exception.

Also simplified the strip_parameters() function which is
used internally and made minor updates to the template and
JavaScript files to match the backend changes and model field names.

Note:
Removal of tags bug is #174 which is fixed in PR #177

Signed-off-by: Mr. Senko <atodorov@mrsenko.com>

atodorov added a commit to MrSenko/Nitrate that referenced this issue May 12, 2017

Fix tags search and hint while adding tags to test cases in TP
How to reproduce:
- Open a Test Plan
- Go to Cases tab
- Select few test cases
- click Tag -> Add Tag button
- start typing tag name
- if there are tags which match the text they will be shown
  as a drop-down hint. This was previously raising an exception.

Also introduced a slight performance optimization by using
QuerySet.values() method to fetch only the field name we're interested
in, not everything.

Note: this commit makes use of the TestCaseTag class instead of the
TestTag class in order to convert ORM queries to child -> parent
relationship, instead of parent -> child one.

Updated JavaScript files to match the backend changes and model
field names.

Note:
Removal of tags bug is #174 which is fixed in PR #177

Signed-off-by: Mr. Senko <atodorov@mrsenko.com>

atodorov added a commit to MrSenko/Nitrate that referenced this issue May 24, 2017

atodorov added a commit to MrSenko/Nitrate that referenced this issue May 24, 2017

Fix tags search and hint while adding tags to test cases in TP
How to reproduce:
- Open a Test Plan
- Go to Cases tab
- Select few test cases
- click Tag -> Add Tag button
- start typing tag name
- if there are tags which match the text they will be shown
  ad a drop-down hint. This was previously raising an exception.

Also simplified the strip_parameters() function which is
used internally and made minor updates to the template and
JavaScript files to match the backend changes and model field names.

Note:
Removal of tags bug is #174 which is fixed in PR #177

Signed-off-by: Mr. Senko <atodorov@mrsenko.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment