diff --git a/boards/models/post.py b/boards/models/post.py --- a/boards/models/post.py +++ b/boards/models/post.py @@ -112,8 +112,8 @@ class PostManager(models.Manager): Thread.objects.process_oldest_threads() self.connect_replies(post) - logger.info('Created post #%d with title %s and key %s' - % (post.id, post.get_title(), post.global_id.key)) + logger.info('Created post #%d with title %s' + % (post.id, post.get_title())) return post diff --git a/boards/tests/test_keys.py b/boards/tests/test_keys.py --- a/boards/tests/test_keys.py +++ b/boards/tests/test_keys.py @@ -25,12 +25,8 @@ class KeyTest(TestCase): def test_primary_constraint(self): KeyPair.objects.generate_key(key_type='ecdsa', primary=True) - try: + with self.assertRaises(Exception): KeyPair.objects.generate_key(key_type='ecdsa', primary=True) - self.fail('Exception should be thrown indicating there can be only' - ' one primary key.') - except Exception: - pass def test_model_id_save(self): model_id = GlobalId(key_type='test', key='test key', local_id='1') @@ -52,10 +48,12 @@ class KeyTest(TestCase): def test_response_get(self): post = self._create_post_with_key() reply_post = Post.objects.create_post(title='test_title', - text='[post]%d[/post]' % post.id, thread=post.get_thread()) + text='[post]%d[/post]' % post.id, + thread=post.get_thread()) reply_reply_post = Post.objects.create_post(title='', - text='[post]%d[/post]' % reply_post.id, - thread=post.get_thread()) + text='[post]%d[/post]' + % reply_post.id, + thread=post.get_thread()) response = Post.objects.generate_response_get([reply_post]) logger.debug(response)