Failing to Run AutodetectorTests Using runtest.py (25253)

56 views
Skip to first unread message

Shun Yu

unread,
Oct 8, 2017, 4:35:33 PM10/8/17
to Django developers (Contributions to Django itself)
I'm trying to run the "migrations.test_autodetector.AutodetectorTests" for django, but I can't seem to get it to work.
I'm using Windows 10 and Python 3.6.2.
Below is the output I'm getting, thanks for the help!

C:\Users\Shun\.virtualenvs\django-original-test\Scripts\python.exe C:/Users/Shun/Desktop/django/django/tests/runtests.py --settings=test_sqlite tests.migrations.test_autodetector.AutodetectorTests
Testing against Django installed in 'c:\users\shun\desktop\django\django\django'
Traceback (most recent call last):
  File "C:/Users/Shun/Desktop/django/django/tests/runtests.py", line 478, in <module>
    options.exclude_tags,
  File "C:/Users/Shun/Desktop/django/django/tests/runtests.py", line 282, in django_tests
    extra_tests=extra_tests,
  File "c:\users\shun\desktop\django\django\django\test\runner.py", line 598, in run_tests
    suite = self.build_suite(test_labels, extra_tests)
  File "c:\users\shun\desktop\django\django\django\test\runner.py", line 484, in build_suite
    tests = self.test_loader.loadTestsFromName(label)
  File "c:\users\shun\appdata\local\programs\python\python36\Lib\unittest\loader.py", line 153, in loadTestsFromName
    module = __import__(module_name)
  File "c:\users\shun\desktop\django\django\tests\migrations\test_autodetector.py", line 18, in <module>
    from .models import FoodManager, FoodQuerySet
  File "c:\users\shun\desktop\django\django\tests\migrations\models.py", line 9, in <module>
    class ModelWithCustomBase(models.Model, metaclass=CustomModelBase):
  File "c:\users\shun\desktop\django\django\django\db\models\base.py", line 108, in __new__
    "INSTALLED_APPS." % (module, name)
RuntimeError: Model class tests.migrations.models.ModelWithCustomBase doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

Process finished with exit code 1


Shun Yu

unread,
Oct 8, 2017, 11:51:21 PM10/8/17
to Django developers (Contributions to Django itself)
When I try to run the whole test suite it works fine, it's just that when I try to run this specific one it's failing on me.

Shai Berger

unread,
Oct 13, 2017, 11:52:48 AM10/13/17
to django-d...@googlegroups.com
I can see the problem as well, and I can see it in 2.0 and 1.11 too. Please
open a new bug on the testing framework.

Tim Graham

unread,
Oct 13, 2017, 12:47:07 PM10/13/17
to Django developers (Contributions to Django itself)
The "tests" prefix shouldn't be included in "tests.migrations.test_autodetector.AutodetectorTests". Perhaps runtests.py could raise a helpful message for that mistake.
Reply all
Reply to author
Forward
0 new messages