def test_regulaer_user_cannot_direct_message_regular_user(self):
        sender = self.create_user()
        recipient = self.create_user()
        self.login(sender)

        # Attempt to POST a new direct message to a regular user, sent from
        # another regular user
        response = self.client.post(
            reverse('create_direct_message',
                    kwargs={'user_uuid': recipient.uuid}),
            {'text': 'hello', 'subject': 'quick dm'}
        )

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

        # Confirm that the user received an error
        self.assertIn(
            'You don\'t have permission to direct message {user}'.format(
                user=recipient),
            str(response.cookies)
        )

        # Confirm that no new message was created for the recipient
        self.assertFalse(UserThread.objects.filter(user=recipient).exists())
Constructor.
dataset/ETHPy150Open ofa/connect/open_connect/connectmessages/tests/test_views.py/DirectMessageCreateViewTest.test_regulaer_user_cannot_direct_message_regular_user--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/datastore/datastore_query.py/ResultsIterator.__init__