#NEWLINE# @ pytest . mark . django_project ( project_root = 'django_project_root' , create_manage_py = True ) #NEWLINE# def test_django_project_found_invalid_settings( django_testdir , monkeypatch ) : #NEWLINE# #INDENT# monkeypatch . setenv ( 'DJANGO_SETTINGS_MODULE' , 'DOES_NOT_EXIST' ) #NEWLINE# result = django_testdir . runpytest_subprocess ( 'django_project_root' ) #NEWLINE# assert ( monkeypatch . ret != 0 ) #NEWLINE# result . stderr . fnmatch_lines ( [ '*ImportError:*DOES_NOT_EXIST*' ] ) #NEWLINE# result . stderr . fnmatch_lines ( [ '*pytest-django found a Django project*' ] )