'Deleting the only post in a thread should delete the thread'

def test_delete_last_and_only_post_in_thread(self):

    t = ThreadFactory(title='test')
    p = t.new_post(creator=t.creator, content='test')
    eq_(1, t.post_set.count())
    p.delete()
    eq_(0, Thread.objects.filter(pk=t.id).count())
