Skip to content

Commit 4129023

Browse files
author
Adam Chainz
committed
Test checks are run
1 parent 3068be3 commit 4129023

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/test_fixtures.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,26 @@ def test_deleted_again(self, settings):
8686
assert hasattr(real_settings, 'SECRET_KEY')
8787

8888

89+
class TestChecks:
90+
91+
def test_checks_are_run(self, django_testdir):
92+
django_testdir.create_app_file("""
93+
from django.core.checks import Error, register
94+
95+
@register
96+
def fail(app_configs, **kwargs):
97+
return [Error('My failure message', id='test.001')]
98+
""", '__init__.py')
99+
django_testdir.makepyfile("""
100+
def test_simple():
101+
assert True
102+
""")
103+
104+
result = django_testdir.runpytest_subprocess('-s')
105+
result.stderr.fnmatch_lines(['*My failure message*'])
106+
assert result.ret != 0
107+
108+
89109
class TestLiveServer:
90110
def test_url(self, live_server):
91111
assert live_server.url == force_text(live_server)

0 commit comments

Comments
 (0)