# HG changeset patch # User neko259 # Date 2014-02-05 19:23:02 # Node ID 9c391cc4f3c49437cce82022541cd9971676813a # Parent 07bcda87627c9110421b581cab4b077363964ea6 Updated tests to use get_thread() method of post diff --git a/boards/tests.py b/boards/tests.py --- a/boards/tests.py +++ b/boards/tests.py @@ -53,7 +53,7 @@ class PostTests(TestCase): """Test thread deletion""" opening_post = self._create_post() - thread = opening_post.thread_new + thread = opening_post.get_thread() reply = Post.objects.create_post("", "", thread=thread) thread.delete_with_posts() @@ -64,10 +64,10 @@ class PostTests(TestCase): """Test adding post to a thread""" op = self._create_post() - post = Post.objects.create_post("", "", thread=op.thread_new) + post = Post.objects.create_post("", "", thread=op.get_thread()) self.assertIsNotNone(post, 'Reply to thread wasn\'t created') - self.assertEqual(op.thread_new.last_edit_time, post.pub_time, + self.assertEqual(op.get_thread().last_edit_time, post.pub_time, 'Post\'s create time doesn\'t match thread last edit' ' time') @@ -88,9 +88,9 @@ class PostTests(TestCase): for i in range(0, 2): Post.objects.create_post('title', 'text', - thread=opening_post.thread_new) + thread=opening_post.get_thread()) - thread = opening_post.thread_new + thread = opening_post.get_thread() self.assertEqual(3, thread.replies.count()) @@ -100,7 +100,7 @@ class PostTests(TestCase): tag = Tag.objects.create(name='test_tag') post = Post.objects.create_post(title='title', text='text', tags=[tag]) - thread = post.thread_new + thread = post.get_thread() self.assertIsNotNone(post, 'Post not created') self.assertTrue(tag in thread.tags.all(), 'Tag not added to thread') self.assertTrue(thread in tag.threads.all(), 'Thread not added to tag') @@ -138,7 +138,7 @@ class PostTests(TestCase): post = Post.objects.create_post("", "", tags=[tag]) - self.assertTrue(linked_tag in post.thread_new.tags.all(), + self.assertTrue(linked_tag in post.get_thread().tags.all(), 'Linked tag was not added')