'Sorting threads by replies.'

def test_sorting_replies(self):

    t1 = ThreadFactory()
    t1.new_post(t1.creator, 'foo')
    t2 = ThreadFactory()
    t2.new_post(t2.creator, 'bar')
    t2.new_post(t2.creator, 'baz')
    threads = sort_threads(Thread.objects, 4)
    self.assertLessEqual(threads[0].replies, threads[1].replies)
    eq_(threads[0].replies, t1.replies)
    eq_(threads[1].replies, t2.replies)
    eq_(threads[0].title, t1.title)
    eq_(threads[1].title, t2.title)
