Show More
@@ -178,8 +178,8 b' class PostManager(models.Manager):' | |||||
178 | """Connect replies to a post to show them as a refmap""" |
|
178 | """Connect replies to a post to show them as a refmap""" | |
179 |
|
179 | |||
180 | for reply_number in re.finditer(REGEX_REPLY, post.text.raw): |
|
180 | for reply_number in re.finditer(REGEX_REPLY, post.text.raw): | |
181 | id = reply_number.group(1) |
|
181 | post_id = reply_number.group(1) | |
182 | ref_post = self.filter(id=id) |
|
182 | ref_post = self.filter(id=post_id) | |
183 | if ref_post.count() > 0: |
|
183 | if ref_post.count() > 0: | |
184 | referenced_post = ref_post[0] |
|
184 | referenced_post = ref_post[0] | |
185 | referenced_post.referenced_posts.add(post) |
|
185 | referenced_post.referenced_posts.add(post) |
@@ -39,6 +39,15 b' class BoardTests(TestCase):' | |||||
39 |
|
39 | |||
40 | self.assertFalse(Post.objects.exists(post_id)) |
|
40 | self.assertFalse(Post.objects.exists(post_id)) | |
41 |
|
41 | |||
|
42 | def test_post_to_thread(self): | |||
|
43 | op = self._create_post() | |||
|
44 | post = Post.objects.create_post("", "", thread=op) | |||
|
45 | ||||
|
46 | self.assertIsNotNone(post, 'Reply to thread wasn\'t created') | |||
|
47 | self.assertEqual(op.last_edit_time, post.pub_time, | |||
|
48 | 'Post\'s create time doesn\'t match thread last edit' | |||
|
49 | ' time') | |||
|
50 | ||||
42 | def test_delete_posts_by_ip(self): |
|
51 | def test_delete_posts_by_ip(self): | |
43 | post = self._create_post() |
|
52 | post = self._create_post() | |
44 | post_id = post.id |
|
53 | post_id = post.id |
General Comments 0
You need to be logged in to leave comments.
Login now