pytest
-
Github Action으로 django test 하기(CI)Django testing 2021. 6. 4. 12:37
github 으로 들어간 후, 본인의 프로젝트로 들어가서 아래 이미지처럼 'Actions'를 선택합니다. 들어간 후, 처음엔 Django 에 관한 부분이 없지만 Continuous integration workflows 부분 중 'More continuos integration workflows' conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: could not connect to server: Connection refused E Is the server running on host "localhost" (::1) and accepting E TCP/IP connection..
-
Django 에서 pytest 사용하기Django 2021. 6. 3. 17:33
1. pytest 설치 지난 시간 이어서 pytest 를 사용하기 위해 새로 설치한다. pip install pytest-django pytest-django를 설치하면 자동적으로 최신버전의 pytest도 같이 설치된다. pytest-django는 pytest의 플러그인 시스템을 사용하고 특별한 설정 없이 설치 후에 바로 사용 가능하다. 설치 이후, pytest 란 명령어로 실행해보면 pytest 다음과 같이 django에서 설정을 해주지 않아서 오류가 발생하고 있는것을 확인된다. E django.core.exceptions.ImproperlyConfigured: Requested settings, but settings are not configured. You must either define the..