Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
fix file-chooser test
Browse files Browse the repository at this point in the history
  • Loading branch information
cvan committed Mar 19, 2013
1 parent e4c16fb commit 7093893
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions apps/files/tests/test_views.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -444,17 +444,15 @@ def test_file_chooser_selection(self):
str(self.files[0].id)) str(self.files[0].id))
eq_(len(doc('#id_right option[value][selected]')), 0) eq_(len(doc('#id_right option[value][selected]')), 0)


@patch.object(amo.PLATFORM_LINUX, 'name', u'所有移动平台')
def test_file_chooser_non_ascii_platform(self): def test_file_chooser_non_ascii_platform(self):
with self.activate(locale='zh-CN'): with self.activate(locale='zh-CN'):
PLATFORM_NAME = u'所有移动平台' PLATFORM_NAME = u'所有移动平台'
f = self.files[0] f = self.files[0]
mobile = Platform.objects.get(id=amo.PLATFORM_ALL_MOBILE.id)
f.update(platform=mobile)

eq_(unicode(f.platform), PLATFORM_NAME) eq_(unicode(f.platform), PLATFORM_NAME)


res = self.client.get(self.file_url()) 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(), eq_(doc('#id_left option[value=%d]' % f.id).text(),
PLATFORM_NAME) PLATFORM_NAME)
Expand Down

0 comments on commit 7093893

Please sign in to comment.