From d54e4fbafef4d5763ead82be2809078e975f205b Mon Sep 17 00:00:00 2001 From: Jeff Balogh Date: Tue, 24 Aug 2010 10:04:40 -0700 Subject: [PATCH] test fixes --- apps/api/tests.py | 3 ++- apps/search/tests/test_views.py | 9 +++------ apps/users/models.py | 2 +- apps/users/tests/test_views.py | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/apps/api/tests.py b/apps/api/tests.py index 36153300ab..2eabbbfd37 100644 --- a/apps/api/tests.py +++ b/apps/api/tests.py @@ -173,7 +173,8 @@ class APITest(TestCase): """{2fa4ed95-0317-4c6a-a74c-5f3e3912c1f9}""") self.assertContains(response, "2.1.072") self.assertContains(response, """Public""") - self.assertContains(response, '55021') + self.assertContains(response, + u'55021 \u0627\u0644\u062a\u0637\u0628') self.assertContains(response, "Delicious Bookmarks is the") self.assertContains(response, "This extension integrates") diff --git a/apps/search/tests/test_views.py b/apps/search/tests/test_views.py index 06f54da599..4e8c2e0d0b 100644 --- a/apps/search/tests/test_views.py +++ b/apps/search/tests/test_views.py @@ -179,7 +179,8 @@ class FrontendSearchTest(SphinxTestCase): are returning them.""" resp = self.get_response(q='grapple') doc = pq(resp.content) - eq_('GrApple Yummy Aronnax', doc('.item h3 a').text()) + eq_(u'GrApple Yummy Aronnax \u0627\u0644\u062a\u0637\u0628', + doc('.item h3 a').text()) def test_tag_refinement(self): """Don't show the tag list if there's no tags to be shown.""" @@ -238,7 +239,6 @@ class ViewTest(test_utils.TestCase): assert views._get_tags(self.fake_request, tags=[t], selected='yermom') - class AjaxTest(SphinxTestCase): fixtures = ('base/addon_3615',) @@ -253,8 +253,7 @@ class AjaxTest(SphinxTestCase): ('id', addon.id), ('icon', addon.icon_url), ('label', unicode(addon.name)), - ('value', unicode(addon.name).lower()) - ) + ('value', unicode(addon.name).lower())) for val, expected in check_me: check(val, expected) @@ -264,5 +263,3 @@ class AjaxTest(SphinxTestCase): searchclient.side_effect = SearchError() r = self.client.get(reverse('search.ajax') + '?q=del') eq_('[]', r.content) - - diff --git a/apps/users/models.py b/apps/users/models.py index 69d8755e84..c00b9cb637 100644 --- a/apps/users/models.py +++ b/apps/users/models.py @@ -128,7 +128,7 @@ class UserProfile(amo.models.ModelBase): return self._reviews_all.filter(reply_to=None) def anonymize(self): - log.info("User (%s: <%s>) is being anonymized." % (self, self.email)) + log.info(u"User (%s: <%s>) is being anonymized." % (self, self.email)) self.email = "" self.password = "sha512$Anonymous$Password" self.firstname = "" diff --git a/apps/users/tests/test_views.py b/apps/users/tests/test_views.py index 1651eaf0fc..fa37381622 100644 --- a/apps/users/tests/test_views.py +++ b/apps/users/tests/test_views.py @@ -35,7 +35,7 @@ class TestAjax(UserViewBase): r = self.client.get(url, follow=True) data = json.loads(r.content) eq_(data['id'], 9945) - eq_(data['name'], 'Justin Scott') + eq_(data['name'], u'Justin Scott \u0627\u0644\u062a\u0637\u0628') def test_forbidden(self): url = reverse('users.ajax')