Browse Source

Improved testutils for threads

Rafał Pitoń 10 years ago
parent
commit
23f5237fe3
2 changed files with 5 additions and 3 deletions
  1. 0 1
      misago/forums/tests/test_forum_model.py
  2. 5 2
      misago/threads/testutils.py

+ 0 - 1
misago/forums/tests/test_forum_model.py

@@ -57,7 +57,6 @@ class ForumModelTests(TestCase):
         datetime = timezone.now()
 
         thread = testutils.post_thread(self.forum)
-        post = testutils.reply_thread(thread)
 
         return thread
 

+ 5 - 2
misago/threads/testutils.py

@@ -42,8 +42,11 @@ def post_thread(forum, title='Test thread', weight=0, poster='Tester',
         })
 
     thread = Thread.objects.create(**kwargs)
-    forum.synchronize()
-    forum.save()
+    reply_thread(thread,
+        poster=poster,
+        posted_on=thread.last_post_on,
+        is_moderated=is_moderated)
+
     return thread