def tests_unarchives(self):
        group = self.create_group()
        user1 = self.create_user()
        user2 = self.create_user()

        user1.add_to_group(group.pk)
        user2.add_to_group(group.pk)

        thread = self.create_thread(
            group=group, sender=user1, create_recipient=False)

        # Since we mock-out send_message in `Message.save()` we have to call
        # `send_message` directly to generate userthreads
        send_message(thread.first_message.pk)

        thread.userthread_set.update(status='archived')
        self.assertEqual(
            thread.userthread_set.filter(
                status='archived').count(),
            2
        )

        newmessage = mommy.make(Message, thread=thread, sender=user1)
        send_message(newmessage.pk)

        # Author of new message should still have thread archived
        self.assertTrue(
            thread.userthread_set.filter(
                status='archived', user=user1).exists()
        )
        # User 2 should have the thread unarchived
        self.assertTrue(
            thread.userthread_set.filter(
                status='active', user=user2).exists()
        )
Sending a message to an archived thread should unarchive it.
dataset/ETHPy150Open ofa/connect/open_connect/connectmessages/tests/test_tasks.py/SendGroupMessageTest.tests_unarchives