文章标题

第一个单元测试通过。
$ python manage.py test
Creating test database for alias ‘default’…
.———————————————————————-
Ran 1 test in 0.002s
OK
Destroying test database for alias ‘default’…

$ git diff
diff –git a/.gitignore b/.gitignore
index 49ef255..3ba11e5 100644
— a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
db.sqlite3
+pycache
+*.pyc
diff –git a/geckodriver.log b/geckodriver.log
index 4acb960..ba571e6 100644
— a/geckodriver.log
+++ b/geckodriver.log
@@ -53,3 +53,12 @@ JavaScript error: http://bdimg.share.baidu.com/static/api/js/trans/logger.js?v=d
1481553714807 Marionette INFO Listening on port 37657
^G[Child 7364] ###!!! ABORT: Aborting on channel error.: file /build/firefox-RaD34G/firefox-50.0+build2/ipc/glue/MessageChannel.cpp, line 2056
[Child 7364] ###!!! ABORT: Aborting on channel error.: file /build/firefox-RaD34G/firefox-50.0+build2/ipc/glue/MessageChannel.cpp, line 2056
+
+(firefox:5917): Gdk-WARNING **: firefox: Fatal IO error 11 (资源暂时不可用) on X server :0.
+(/usr/lib/firefox/plugin-container:5982): Gdk-WARNING **: /usr/lib/firefox/plugin-container: Fatal IO error 11 (资源暂时不可用) on X server :0.
+
+/usr/lib/firefox/plugin-container: Fatal IO error 11 (资源暂时不可用) on X server :0.
+^G[NPAPI 6983] ###!!! ABORT: Aborting on channel error.: file /build/firefox-RaD34G/firefox-50.0+build2/ipc/glue/MessageChannel.cpp, line 2056
+[NPAPI 6983] ###!!! ABORT: Aborting on channel error.: file /build/firefox-RaD34G/firefox-50.0+build2/ipc/glue/MessageChannel.cpp, line 2056
diff –git a/lists/tests.py b/lists/tests.py
index e3ac0ca..daacc8a 100644
— a/lists/tests.py
+++ b/lists/tests.py
@@ -1,8 +1,17 @@
-from django.test import TestCase
+#from django.test import TestCase

# Create your tests here

-class SmokeTest(TestCase):
- def test_bad_maths(self):
- self.assertEqual(1+1,3)
+#class SmokeTest(TestCase):
+# def test_bad_maths(self):
+# self.assertEqual(1+1,3)
+
+from django.core.urlresolvers import resolve
+from django.test import TestCase
+from lists.views import home_page
+
+class HomePageTest(TestCase):
+ def test_root_url_resolves_to_home_page_views(self):
+ found = resolve(‘/’)
+ self.assertEqual(found.func,home_page)

$diff –git a/lists/views.py b/lists/views.py

$git commit –am “First unit test and url mapping,dummy view”
test and url mapping,dummy view”
[master 91ea60f] First unit test and url mapping,dummy view
5 files changed, 31 insertions(+), 5 deletions(-)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值