Browse files

fix file-chooser test

  • Loading branch information...
1 parent e4c16fb commit 709389359041838dfdc5fff97b3414e273b01db7 @cvan cvan committed Mar 18, 2013
Showing with 2 additions and 4 deletions.
  1. +2 −4 apps/files/tests/test_views.py
View
6 apps/files/tests/test_views.py
@@ -444,17 +444,15 @@ def test_file_chooser_selection(self):
str(self.files[0].id))
eq_(len(doc('#id_right option[value][selected]')), 0)
+ @patch.object(amo.PLATFORM_LINUX, 'name', u'所有移动平台')
def test_file_chooser_non_ascii_platform(self):
with self.activate(locale='zh-CN'):
PLATFORM_NAME = u'所有移动平台'
f = self.files[0]
- mobile = Platform.objects.get(id=amo.PLATFORM_ALL_MOBILE.id)
- f.update(platform=mobile)
-
eq_(unicode(f.platform), PLATFORM_NAME)
res = self.client.get(self.file_url())
- doc = pq(res.content)
+ doc = pq(res.content.decode('utf-8'))
eq_(doc('#id_left option[value=%d]' % f.id).text(),
PLATFORM_NAME)

0 comments on commit 7093893

Please sign in to comment.