[Django]-Django 1.7 – How do I suppress "(1_6.W001) Some project unittests may not execute as expected."?

9👍

It looks like the developers have decided to remove this warning:

https://code.djangoproject.com/ticket/23469

👤Arklon

45👍

Found a blog post that reveals explicitly specifying

TEST_RUNNER = 'django.test.runner.DiscoverRunner'

in settings.py will stop this warning from occurring.

10👍

See https://github.com/django/django/blob/1.7/django/core/checks/compatibility/django_1_6_0.py#L42 for the list of things it checks that gives you this error.

👤xeor

9👍

You can silence individual system check warnings with the SILENCED_SYSTEM_CHECKS setting.

Regarding your other question about how to find the reasons why this warning was triggered, the only place I could find was by looking at the source code.

8👍

If everything’s OK with your tests, you can simply turn the warning off by doing one (or all) of these steps:

  1. Remove SITE_ID from your settings if you don’t use sites framework anymore.

  2. Add BASE_DIR variable to your settings.

  3. Remove MANAGERS list form your setting if you don’t use it.

  4. Remove XFrameOptionsMiddleware middleware in settings. (It’s enabled by default in Django 1.6+ anyway)

  5. Remove custom TEMPLATE_LOADERS or ADMINS if you don’t need them (you usually do, so don’t do it unless you know what you’re doing).

Those are two things current heuristics (Django 1.7.3) checks in order to detect if your project was generated by Django <1.6.

Leave a comment