def test_user_cannot_message_self(self):
        sender = self.create_superuser()
        self.login(sender)

        # Attempt to get the sender's create_direct_message form as sender
        response = self.client.get(
            reverse('create_direct_message',
                    kwargs={'user_uuid': sender.uuid})
            )

        # Confirm that the user was immediately redirected
        self.assertEqual(response.status_code, 302)

        # Confirm that a permission exception was thrown
        self.assertIn(
            'You don\'t have permission to direct message {user}'.format(
                user=sender),
            str(response.cookies)
        )
Test that users cannot message themselves.
dataset/ETHPy150Open ofa/connect/open_connect/connectmessages/tests/test_views.py/DirectMessageCreateViewTest.test_user_cannot_message_self