﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27295	Add a system check to prohibit models that start with an underscore	Victor Porton	Quentin Fulsher	"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'...
}}}
"	Cleanup/optimization	closed	Core (System checks)	1.10	Normal	fixed			Accepted	1	0	0	0	1	0
