{"id":509,"date":"2014-04-18T15:20:05","date_gmt":"2014-04-18T14:20:05","guid":{"rendered":"http:\/\/daniel.hepper.net\/blog\/?p=509"},"modified":"2014-05-06T22:31:33","modified_gmt":"2014-05-06T21:31:33","slug":"fixing-1_6-w001-when-upgrading-from-django-1-5-to-1-7","status":"publish","type":"post","link":"https:\/\/daniel.hepper.net\/blog\/2014\/04\/fixing-1_6-w001-when-upgrading-from-django-1-5-to-1-7\/","title":{"rendered":"Fixing 1_6.W001 when upgrading from Django 1.5 to 1.7"},"content":{"rendered":"<p>After upgrading a Django project from Django 1.5 to the current beta of Django 1.7, running the tests triggered a warning:<\/p>\n<pre>System check identified some issues:\r\n\r\nWARNINGS:\r\n\r\n?: (1_6.W001) Some project unittests may not execute as expected.\r\n\tHINT: Django 1.6 introduced a new default test runner. It looks like this project was generated using Django 1.5 or earlier. You should ensure your tests are all running &amp; behaving as expected. See https:\/\/docs.djangoproject.com\/en\/dev\/releases\/1.6\/#discovery-of-tests-in-any-test-module for more information.<\/pre>\n<p>This warning is printed by the <a href=\"https:\/\/docs.djangoproject.com\/en\/1.7\/ref\/checks\/\">System Check Framework<\/a>, which is new in Django 1.7 and checks your project for common problems. You can run it manually with the <a href=\"https:\/\/docs.djangoproject.com\/en\/1.7\/ref\/django-admin\/#django-admin-check\">&#8220;check&#8221; management command.<\/a><\/p>\n<pre>python manage.py check<\/pre>\n<p>After verifying that all my tests are run, I was left wondering how I can silence the warning after reading (okay, let&#8217;s be honest: skimming) the release notes of 1.6. The answer is simple, but I had to look in the source of the system check framework to find it. Apparently you have to explicitly define a test runner starting from Django 1.6. To do so, add the following line to your settings:<\/p>\n<pre>TEST_RUNNER = 'django.test.runner.DiscoverRunner'<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>After upgrading a Django project from Django 1.5 to the current beta of Django 1.7, running the tests triggered a warning: System check identified some issues: WARNINGS: ?: (1_6.W001) Some project unittests may not execute as expected. HINT: Django 1.6 &hellip; <a href=\"https:\/\/daniel.hepper.net\/blog\/2014\/04\/fixing-1_6-w001-when-upgrading-from-django-1-5-to-1-7\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,11,35],"tags":[],"class_list":["post-509","post","type-post","status-publish","format-standard","hentry","category-django","category-howto","category-python"],"_links":{"self":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts\/509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/comments?post=509"}],"version-history":[{"count":2,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts\/509\/revisions"}],"predecessor-version":[{"id":512,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts\/509\/revisions\/512"}],"wp:attachment":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/media?parent=509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/categories?post=509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/tags?post=509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}