我在django中有以下test.py文件。你能解释一下这段代码吗?Python中的实际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(联系人)=='John Smith',如果不是那么断言相等是失败 –
你问过写这个的人吗? –
你可以请定义什么assertEquals是什么? – Rockhound