-
카테고리
-
세부 분야
풀스택
-
해결 여부
미해결
작동은 하는데 테스트에서 failed가 떠요
19.09.25 00:29 작성 조회수 161
0
C:\github\django-leaftha-first-website (master -> origin)
(venv) λ python manage.py test
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
.E
======================================================================
ERROR: test_post_list (blog.tests.Testview)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\github\django-leaftha-first-website\blog\tests.py", line 60, in test
_post_list
self.assertEqual(post_000_read_more_btn['href'], post_000.get_absolute_url(
))
TypeError: 'NoneType' object is not subscriptable
----------------------------------------------------------------------
Ran 2 tests in 0.250s
FAILED (errors=1)
Destroying test database for alias 'default'...
답변을 작성해보세요.
0
SungYong Lee
지식공유자2019.09.26
전체 코드를 올려주시지 않았기 때문에 문제를 정확히 파악하기 어렵습니다. 현재 주어진 정보로만 파악해보자면, 이것은 post_000_read_more_btn 이 없기 때문에 발생하는 문제로 보입니다.
test 코드와 html파일 모두 확인하셔서 post_000_read_more_btn 이 제대로 명시되어 있는지 검토해주세요.
답변 1