小编Roc*_*und的帖子

什么是Python中的assertEquals?

我在django中有以下test.py文件.你能解释一下这段代码吗?

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',
        )
Run Code Online (Sandbox Code Playgroud)

python django django-tests

9
推荐指数
2
解决办法
4万
查看次数

标签 统计

django ×1

django-tests ×1

python ×1