我在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