# HG changeset patch # User raph # Date 1274101650 -7200 # Node ID 3d25afbd78ff9d2289eea285d01a8f228498c61f # Parent 588ca38ccb61e56ea056764ca4e7e5b6b39b8a50 fix unit tests diff -r 588ca38ccb61 -r 3d25afbd78ff src/cm/denorm_engine.py --- a/src/cm/denorm_engine.py Fri May 14 15:17:44 2010 +0200 +++ b/src/cm/denorm_engine.py Mon May 17 15:07:30 2010 +0200 @@ -18,7 +18,8 @@ text = text_version.text text.update_denorm_fields() except Text.DoesNotExist: - logging.warning('No text found for text_version: %i' %text_version.id) + pass + #logging.warning('No text found for text_version: %i' %text_version.id) def connect_all(): diff -r 588ca38ccb61 -r 3d25afbd78ff src/cm/fixtures/test_comments.json --- a/src/cm/fixtures/test_comments.json Fri May 14 15:17:44 2010 +0200 +++ b/src/cm/fixtures/test_comments.json Mon May 17 15:07:30 2010 +0200 @@ -18,6 +18,7 @@ "content": "simple text
simple text
simple text
simple text
simple text
simple text
simple text
simple text
simple text
simple text
simple text
simple text
simple text
simple text
simple text
simple text
simple text
simple text
", "created": "2009-02-13 03:27:05", "format": "html", + "key": "keyTextVersion", "modified": "2009-02-13 03:27:05", "note": "ma note", "text": 1, diff -r 588ca38ccb61 -r 3d25afbd78ff src/cm/tests/test_comment_positioning.py --- a/src/cm/tests/test_comment_positioning.py Fri May 14 15:17:44 2010 +0200 +++ b/src/cm/tests/test_comment_positioning.py Mon May 17 15:07:30 2010 +0200 @@ -55,32 +55,32 @@ self.assert_comment(id, x, y, z, k) def test_wrapper_shifted(self): - content = """This is a test text""" - new_content = """This is a teeest text""" + content = u"""This is a test text""" + new_content = u"""This is a teeest text""" self.preserve_comment_pos(content, new_content, [([2,2,2,4],[4,4,2,4]),]) def test_comment_removed(self): - content = """This is a test text""" - new_content = """This is a test txt""" + content = u"""This is a test text""" + new_content = u"""This is a test txt""" self.preserve_comment_pos(content, new_content, [([2,2,2,4],None),]) def test_offset_shifted(self): - content = """This is a test text""" - new_content = """a teXXXsta text""" + content = u"""This is a test text""" + new_content = u"""a teXXXsta text""" self.preserve_comment_pos(content, new_content, [([2,2,2,4],[2,2,3,5]),]) def test_insert_wrapper(self): - content = """This is a test text""" - new_content = """This is a test text""" + content = u"""This is a test text""" + new_content = u"""This is a test text""" self.preserve_comment_pos(content, new_content, [([2,2,2,5],[2,4,2,1]),]) def test_multiwrapper(self): - content = """This is a test text""" - new_content = """This is a testXXXXXXXXXXXX text""" + content = u"""This is a test text""" + new_content = u"""This is a testXXXXXXXXXXXX text""" self.preserve_comment_pos(content, new_content, [([0,2,2,4],None),]) - def test_insert_wrapper(self): - content = """aatestbb""" - new_content = """aXatestbXb""" + def test_insert_wrapper2(self): + content = u"""aatestbb""" + new_content = u"""aXatestbXb""" self.preserve_comment_pos(content, new_content, [([0,2,1,1],[0,2,2,1]),]) diff -r 588ca38ccb61 -r 3d25afbd78ff src/cm/tests/test_history.py --- a/src/cm/tests/test_history.py Fri May 14 15:17:44 2010 +0200 +++ b/src/cm/tests/test_history.py Mon May 17 15:07:30 2010 +0200 @@ -9,8 +9,6 @@ def test_revert(self): text = Text.objects.all()[0] - #for i in range(1,text.get_versions_number()+1): - text_version = Text.last_text_version + text_version = text.last_text_version text.revert_to_version(text_version.key) - #self.assertEqual(Comment.objects.count(), 16) diff -r 588ca38ccb61 -r 3d25afbd78ff src/cm/tests/test_notifications.py --- a/src/cm/tests/test_notifications.py Fri May 14 15:17:44 2010 +0200 +++ b/src/cm/tests/test_notifications.py Mon May 17 15:07:30 2010 +0200 @@ -19,7 +19,7 @@ # subscribe to workspace notifications response = c.post('/followup/', {'notif_id': u'workspace_notify_check', - 'workspace_notify_check': u'workspace_notify_check', + 'workspace_notify_check': u'true', }) self.assertEquals(len(Notification.objects.all()), 1) diff -r 588ca38ccb61 -r 3d25afbd78ff src/cm/tests/test_structure.py --- a/src/cm/tests/test_structure.py Fri May 14 15:17:44 2010 +0200 +++ b/src/cm/tests/test_structure.py Mon May 17 15:07:30 2010 +0200 @@ -25,7 +25,7 @@ # edit with duplication changing content new_text = text.edit(new_title='my title', new_format='html', - new_content='simple textsimple text
simple text
', + new_content=u'simple textsimple text
simple text
', keep_comments = True, cancel_modified_scopes=False, new_version = True) @@ -35,7 +35,7 @@ # edit without duplication, completely changing content new_text = text.edit(new_title='my title', new_format='html', - new_content='xxxxxx', + new_content=u'xxxxxx', keep_comments = True, cancel_modified_scopes=False, new_version = False) @@ -48,7 +48,7 @@ text = Text.objects.all()[0] new_text = text.edit(new_title='my title', new_format='html', - new_content='xxxxxx', + new_content=u'xxxxxx', keep_comments = False, cancel_modified_scopes=False, new_version = False) @@ -61,7 +61,7 @@ text = Text.objects.all()[0] new_text = text.edit(new_title='my title', new_format='html', - new_content='xxxxxx', + new_content=u'xxxxxx', keep_comments = False, cancel_modified_scopes=False, new_version = True)