瀏覽代碼

content.response is supposed to be binary data.

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

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

22
 
22
 
23
 @then('page includes "{text}"')
23
 @then('page includes "{text}"')
24
 def step(context, text):
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
         "%r not page content" % text)
26
         "%r not page content" % text)

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

25
                 'dashboard:users-index',)
25
                 'dashboard:users-index',)
26
         for name in urls:
26
         for name in urls:
27
             response = self.client.get(reverse(name))
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
     def test_includes_hourly_report_with_no_orders(self):
30
     def test_includes_hourly_report_with_no_orders(self):
31
         report = IndexView().get_hourly_report()
31
         report = IndexView().get_hourly_report()

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

17
 
17
 
18
     def test_dashboard_index_is_for_staff_only(self):
18
     def test_dashboard_index_is_for_staff_only(self):
19
         response = self.client.get(reverse('dashboard:page-list'))
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
     def test_dashboard_page_list(self):
22
     def test_dashboard_page_list(self):
23
         response = self.client.get(reverse('dashboard:page-list'))
23
         response = self.client.get(reverse('dashboard:page-list'))

Loading…
取消
儲存