Show More
@@ -53,7 +53,7 b' class PostTests(TestCase):' | |||||
53 | """Test thread deletion""" |
|
53 | """Test thread deletion""" | |
54 |
|
54 | |||
55 | opening_post = self._create_post() |
|
55 | opening_post = self._create_post() | |
56 |
thread = opening_post.thread |
|
56 | thread = opening_post.get_thread() | |
57 | reply = Post.objects.create_post("", "", thread=thread) |
|
57 | reply = Post.objects.create_post("", "", thread=thread) | |
58 |
|
58 | |||
59 | thread.delete_with_posts() |
|
59 | thread.delete_with_posts() | |
@@ -64,10 +64,10 b' class PostTests(TestCase):' | |||||
64 | """Test adding post to a thread""" |
|
64 | """Test adding post to a thread""" | |
65 |
|
65 | |||
66 | op = self._create_post() |
|
66 | op = self._create_post() | |
67 |
post = Post.objects.create_post("", "", thread=op.thread |
|
67 | post = Post.objects.create_post("", "", thread=op.get_thread()) | |
68 |
|
68 | |||
69 | self.assertIsNotNone(post, 'Reply to thread wasn\'t created') |
|
69 | self.assertIsNotNone(post, 'Reply to thread wasn\'t created') | |
70 |
self.assertEqual(op.thread |
|
70 | self.assertEqual(op.get_thread().last_edit_time, post.pub_time, | |
71 | 'Post\'s create time doesn\'t match thread last edit' |
|
71 | 'Post\'s create time doesn\'t match thread last edit' | |
72 | ' time') |
|
72 | ' time') | |
73 |
|
73 | |||
@@ -88,9 +88,9 b' class PostTests(TestCase):' | |||||
88 |
|
88 | |||
89 | for i in range(0, 2): |
|
89 | for i in range(0, 2): | |
90 | Post.objects.create_post('title', 'text', |
|
90 | Post.objects.create_post('title', 'text', | |
91 |
thread=opening_post.thread |
|
91 | thread=opening_post.get_thread()) | |
92 |
|
92 | |||
93 |
thread = opening_post.thread |
|
93 | thread = opening_post.get_thread() | |
94 |
|
94 | |||
95 | self.assertEqual(3, thread.replies.count()) |
|
95 | self.assertEqual(3, thread.replies.count()) | |
96 |
|
96 | |||
@@ -100,7 +100,7 b' class PostTests(TestCase):' | |||||
100 | tag = Tag.objects.create(name='test_tag') |
|
100 | tag = Tag.objects.create(name='test_tag') | |
101 | post = Post.objects.create_post(title='title', text='text', tags=[tag]) |
|
101 | post = Post.objects.create_post(title='title', text='text', tags=[tag]) | |
102 |
|
102 | |||
103 |
thread = post.thread |
|
103 | thread = post.get_thread() | |
104 | self.assertIsNotNone(post, 'Post not created') |
|
104 | self.assertIsNotNone(post, 'Post not created') | |
105 | self.assertTrue(tag in thread.tags.all(), 'Tag not added to thread') |
|
105 | self.assertTrue(tag in thread.tags.all(), 'Tag not added to thread') | |
106 | self.assertTrue(thread in tag.threads.all(), 'Thread not added to tag') |
|
106 | self.assertTrue(thread in tag.threads.all(), 'Thread not added to tag') | |
@@ -138,7 +138,7 b' class PostTests(TestCase):' | |||||
138 |
|
138 | |||
139 | post = Post.objects.create_post("", "", tags=[tag]) |
|
139 | post = Post.objects.create_post("", "", tags=[tag]) | |
140 |
|
140 | |||
141 |
self.assertTrue(linked_tag in post.thread |
|
141 | self.assertTrue(linked_tag in post.get_thread().tags.all(), | |
142 | 'Linked tag was not added') |
|
142 | 'Linked tag was not added') | |
143 |
|
143 | |||
144 |
|
144 |
General Comments 0
You need to be logged in to leave comments.
Login now