Ask Your Question

LANGUAGE_CODE = 'ja' causes many test failures and errors

asked 2014-01-02 05:40:54 -0500

apg's avatar

Changing LANGUAGE_CODE = 'en' to LANGUAGE_CODE = 'ja' in caused many failures and errors (I included failures at the end of this post) when I ran test askbot command.

I am thinking about a workaround to keep LANGUAGE_CODE = 'en' as is and translate the user interface directly inside html files in templates folder. Do you think this workaround works? What else do you suggest?

I guess using .po file together with LANGUAGE_CODE = 'ja' may be the best practice. However, because of those errors, I am hesitant to go this route and possibly end up tweaking the code to pass all the tests.

Any thoughts would be appreciated. Thank you.

====================================================================== FAIL: test_load_object_description_fails (askbot.tests.page_load_tests.CommandViewTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/shihoushiken/askbot/askbot/tests/", line 736, in test_load_object_description_fails self.assertEqual(title, 'Page not found') AssertionError: u'\u30da\u30fc\u30b8\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093' != 'Page not found'

====================================================================== FAIL: test_privatize_public_question (askbot.tests.question_views_tests.PrivateQuestionViewsTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/shihoushiken/askbot/askbot/tests/", line 90, in test_privatize_public_question self.assertFalse(models.Group.objects.get_global_group() in set(question.groups.all())) AssertionError: True is not false

====================================================================== FAIL: test_publish_private_question (askbot.tests.question_views_tests.PrivateQuestionViewsTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/shihoushiken/askbot/askbot/tests/", line 69, in test_publish_private_question self.assertTrue(models.Group.objects.get_global_group() in set(question.groups.all())) AssertionError: False is not true

====================================================================== FAIL: test_answer_question (askbot.tests.post_model_tests.ThreadRenderCacheUpdateTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/shihoushiken/askbot/askbot/tests/", line 547, in test_answer_question self.assertEqual(2, Post.objects.count()) AssertionError: 2 != 1

====================================================================== FAIL: test_edit_question (askbot.tests.post_model_tests.ThreadRenderCacheUpdateTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/shihoushiken/askbot/askbot/tests/", line 504, in test_edit_question self.assertTrue(thread.last_activity_at

question.added_at) AssertionError: False is not true

====================================================================== FAIL: test_retag_question (askbot.tests.post_model_tests.ThreadRenderCacheUpdateTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/shihoushiken/askbot/askbot/tests/", line 522, in test_retag_question self.assertItemsEqual(['tag1', 'tag2'], list(question.thread.tags.values_list('name', flat=True))) AssertionError: Element counts were not equal: First has 1, Second has 0: u'test' First has 0, Second has 1: 'tag1' First has 0, Second has 1: 'tag2'

====================================================================== FAIL: test_thread_summary_locmem_cache (askbot.tests.post_model_tests.ThreadRenderLowLevelCachingTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/shihoushiken/askbot/askbot/tests/", line 370, in test_thread_summary_locmem_cache self.assertTrue(thread.summary_html_cached()) AssertionError: False is not true

edit retag flag offensive close merge delete


I got the same problem when running with "zh-CN", have you solved them?

zheli's avatar zheli  ( 2014-09-27 04:12:05 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-01-02 10:50:05 -0500

Evgeny's avatar

Some of these errors may be related to the full text search capability in postgres - easily tested by just switching the language to 'en' and re-running the tests.

Postgresql (at least for versions up to 9.1) does not support Japanese full text search out of the box, it requires installation of the postgres module textsearch_ja or use other search engine, such as Solr.

Some other of these errors may be due to the test cases being written for the English setup.

edit flag offensive delete link more


Thank you for the comment. It was my fault not to mention that I actually DID use Solr when I ran those tests. I manually tested search capability of Japanese texts and it is working as far as I can tell. All the failures and errors turn passes when I changed 'ja' to 'en'. However, I am concerned some failures or errors if any may be genuine in a sense that they really cause some real problems with language = 'ja'. It is difficult to distinguish those real failures and errors that are caused by the fact that "test cases being written for the English setup."

apg's avatar apg  ( 2014-01-02 20:09:51 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-01-02 05:40:54 -0500

Seen: 432 times

Last updated: Jan 02 '14