환경 : 인 IntelliJ PyCharm, 파이썬 장고, 장고 유닛 테스트 오류로 실행
내가 표준 장고 설치 프로젝트를 사용 sqlite3를
. Unittest를 작성하려고하는데 다음과 같은 오류가 발생합니다. 약간의 연구 끝에, 나는 여기서 끝났다. tests.pyfrom django.test import TestCase as djangoTestCase
import os
import unittest
# Create your tests here.
class TestExample(djangoTestCase):
def setUp(self):
print('setup')
print(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
def test_abc(self):
self.assertEqual(1,1)
def tearDown(self):
print('tearDown')
if __name__ == '__main__':
unittest.main()
이의
DB 구성
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
코드는 내가 노력
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
출력입니다 문서를 읽음으로써 실수를 찾지 만 성공하지 못합니다. 무엇이 문제 일 수 있습니까? 장고와
테스트를 어떻게 실행합니까? 쉘에서'python manage.py test'가 작동합니까? – Alasdair
예, 잘 작동합니다. PyCharm과 약간의 경험이 있습니까? 테스트를 시작하면 설명 된 오류가 발생합니다. –
죄송합니다. PyCharm 구성을 도와 드릴 수 없습니다. – Alasdair