瀏覽代碼

content.response is supposed to be binary data.

master
Xavier Ordoquy 11 年之前
父節點
當前提交
c08837f5c7

+ 1
- 1
tests/features/steps/homepage_steps.py 查看文件

@@ -22,5 +22,5 @@ def step(context, code):
22 22
 
23 23
 @then('page includes "{text}"')
24 24
 def step(context, text):
25
-    ok_(text.encode('utf8') in context.response.content,
25
+    ok_(text.encode('utf8') in context.response.content.decode('utf8'),
26 26
         "%r not page content" % text)

+ 1
- 1
tests/functional/dashboard/dashboard_tests.py 查看文件

@@ -25,7 +25,7 @@ class TestDashboardIndexForStaffUser(ClientTestCase):
25 25
                 'dashboard:users-index',)
26 26
         for name in urls:
27 27
             response = self.client.get(reverse(name))
28
-            self.assertTrue('Password' not in response.content)
28
+            self.assertTrue('Password' not in response.content.decode('utf8'))
29 29
 
30 30
     def test_includes_hourly_report_with_no_orders(self):
31 31
         report = IndexView().get_hourly_report()

+ 1
- 1
tests/functional/dashboard/page_tests.py 查看文件

@@ -17,7 +17,7 @@ class PageViewTests(ClientTestCase):
17 17
 
18 18
     def test_dashboard_index_is_for_staff_only(self):
19 19
         response = self.client.get(reverse('dashboard:page-list'))
20
-        self.assertTrue('Password' not in response.content)
20
+        self.assertTrue('Password' not in response.content.decode('utf8'))
21 21
 
22 22
     def test_dashboard_page_list(self):
23 23
         response = self.client.get(reverse('dashboard:page-list'))

Loading…
取消
儲存