##// END OF EJS Templates
Removed multi replies from tests
neko259 -
r1711:d48d9cb4 default
parent child Browse files
Show More
@@ -155,37 +155,22 b' class PostTests(TestCase):'
155 """
155 """
156
156
157 op1 = Post.objects.create_post(title='title', text='text')
157 op1 = Post.objects.create_post(title='title', text='text')
158 op2 = Post.objects.create_post(title='title', text='text')
159
158
160 thread1 = op1.get_thread()
159 thread1 = op1.get_thread()
161 thread1.max_posts = 5
160 thread1.max_posts = 5
162 thread1.save()
161 thread1.save()
163
162
164 uid_1 = op1.uid
163 uid_1 = op1.uid
165 uid_2 = op2.uid
166
164
167 # Create multi reply
165 # Create multi reply
168 Post.objects.create_post(
166 Post.objects.create_post(
169 title='title', text='text', thread=thread1,
167 title='title', text='text', thread=thread1)
170 opening_posts=[op1, op2])
171 thread_update_time_2 = op2.get_thread().last_edit_time
172 for i in range(6):
168 for i in range(6):
173 Post.objects.create_post(title='title', text='text',
169 Post.objects.create_post(title='title', text='text',
174 thread=thread1)
170 thread=thread1)
175
171
176 self.assertFalse(op1.get_thread().can_bump(),
172 self.assertFalse(op1.get_thread().can_bump(),
177 'Thread is bumpable when it should not be.')
173 'Thread is bumpable when it should not be.')
178 self.assertTrue(op2.get_thread().can_bump(),
179 'Thread is not bumpable when it should be.')
180 self.assertNotEqual(
174 self.assertNotEqual(
181 uid_1, Post.objects.get(id=op1.id).uid,
175 uid_1, Post.objects.get(id=op1.id).uid,
182 'UID of the first OP should be changed but it is not.')
176 'UID of the first OP should be changed but it is not.')
183 self.assertEqual(
184 uid_2, Post.objects.get(id=op2.id).uid,
185 'UID of the first OP should not be changed but it is.')
186
187 self.assertNotEqual(
188 thread_update_time_2,
189 Thread.objects.get(id=op2.get_thread().id).last_edit_time,
190 'Thread last update time should change when the other thread '
191 'changes status.')
General Comments 0
You need to be logged in to leave comments. Login now