#27295: An exception on correct code
-------------------------------+--------------------
Reporter: Victor Porton | Owner: nobody
Type: Bug | Status: new
Component: Core (Other) | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
Running `manage.py test` for the attached Django project causes a
meaningless exception.
It is probably because _UsersGroup class name starts with underscore.
{{{
$ python3 manage.py test
Creating test database for alias 'default'...
E
======================================================================
ERROR: test_users (auth_app.tests.UsersGroupTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/porton/Projects/gnosis-error/auth_app/tests.py", line 13, in
setUp
self.A.subgroups.add(self.B)
File "/usr/lib/python3/dist-
packages/django/db/models/fields/related_descriptors.py", line 881, in add
self._add_items(self.source_field_name, self.target_field_name, *objs)
File "/usr/lib/python3/dist-
packages/django/db/models/fields/related_descriptors.py", line 1025, in
_add_items
.values_list(target_field_name, flat=True)
File "/usr/lib/python3/dist-packages/django/db/models/query.py", line
731, in values_list
clone = self._values(*fields)
File "/usr/lib/python3/dist-packages/django/db/models/query.py", line
714, in _values
query.add_fields(field_names, True)
File "/usr/lib/python3/dist-packages/django/db/models/sql/query.py",
line 1630, in add_fields
name.split(LOOKUP_SEP), opts, alias, allow_many=allow_m2m)
File "/usr/lib/python3/dist-packages/django/db/models/sql/query.py",
line 1402, in setup_joins
names, opts, allow_many, fail_on_missing=True)
File "/usr/lib/python3/dist-packages/django/db/models/sql/query.py",
line 1327, in names_to_path
"Choices are: %s" % (name, ", ".join(available)))
django.core.exceptions.FieldError: Cannot resolve keyword 'to' into field.
Choices are: from__usersgroup, from__usersgroup_id, id, to__usersgroup,
to__usersgroup_id
----------------------------------------------------------------------
Ran 1 test in 0.002s
FAILED (errors=1)
Destroying test database for alias 'default'...
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27295>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.45add727dbfa4f3c9d1c08b24c9d007c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.