Eclipse与Django Unittest

时间:2013-04-13 22:07:41

标签: django eclipse pydev django-testing

我有一组简单的Django测试用例在Eclipse中失败。特别是如果我有类似的东西:

resp =self.client.get('/accounts/newUser/')
self.assertEqual(resp.status_code,200)
self.assertTrue('user' in resp.context)

然后它会失败,因为resp.context是None。我已经设法使用django.test.utils.setup_test_environment()从eclipse运行,但是我必须做一些像resp.context[0][0][0]['user']这样不太理想的事情。

有没有更聪明的方法让Eclipse运行python单元测试?我见过this solution using django-nose from eclipse以及came from here以上的原始解决方案。

0 个答案:

没有答案
相关问题