1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #25415 -- Made DiscoverRunner run system checks.

This commit is contained in:
Adam Chainz
2016-03-18 14:24:13 +00:00
committed by Tim Graham
parent 391c450fba
commit 5eff8a7783
7 changed files with 42 additions and 1 deletions

View File

@@ -1,9 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.checks import register
from django.db import models
class SimpleModel(models.Model):
field = models.IntegerField()
manager = models.manager.Manager()
@register('tests')
def my_check(app_configs, **kwargs):
my_check.did_run = True
return []
my_check.did_run = False

View File

@@ -17,7 +17,7 @@ from django.test.utils import (
from django.utils.encoding import force_text
from django.utils.six import StringIO
from .models import SimpleModel
from .models import SimpleModel, my_check
class DummyObj(object):
@@ -303,3 +303,8 @@ class CheckFrameworkReservedNamesTests(SimpleTestCase):
),
]
self.assertEqual(errors, expected)
class ChecksRunDuringTests(SimpleTestCase):
def test_registered_check_did_run(self):
self.assertTrue(my_check.did_run)