나는 django에서 다음의 test.py 파일을 가지고있다. 이 코드를 설명해 주시겠습니까? 당신의 contact
개체 반환 '존 Smith`의 __str__
경우 통과로실제로 파이썬에서 assertEquals 란 무엇입니까?
from contacts.models import Contact
...
class ContactTests(TestCase):
"""Contact model tests."""
def test_str(self):
contact = Contact(first_name='John', last_name='Smith')
self.assertEquals(
str(contact),
'John Smith',
)
str (contact) == 'John Smith'가 아닌지 확인한 다음 같지 않음을 확인하면 같음이 실패했습니다. –
작성자에게 질문 했습니까? –
실제로 assertEquals가 무엇인지 정의 할 수 있습니까? – Rockhound