First time here? Check out the FAQ!
0

LANGUAGE_CODE = 'ja' causes many test failures and errors

Changing LANGUAGE_CODE = 'en' to LANGUAGE_CODE = 'ja' in settings.py 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/page_load_tests.py", 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/question_views_tests.py", 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/question_views_tests.py", 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/post_model_tests.py", 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/post_model_tests.py", 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/post_model_tests.py", 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/post_model_tests.py", line 370, in test_thread_summary_locmem_cache self.assertTrue(thread.summary_html_cached()) AssertionError: False is not true


apg's avatar
167
apg
asked 2014-01-02 05:40:54 -0500
edit flag offensive 0 remove flag close merge delete

Comments

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
add a comment see more comments

1 Answer

0

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.

Evgeny's avatar
13.2k
Evgeny
answered 2014-01-02 10:50:05 -0500
edit flag offensive 0 remove flag delete link

Comments

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
add a comment see more comments