Exemple #1
0
    def test_is_DM(self):
        # status is NOT a DM
        status = create_status()
        self.failIf(is_DM(status))

        dm = create_direct_message()
        self.failUnless(is_DM(dm))
Exemple #2
0
    def test_authors_username_dm(self):
        user = '******'
        dm = create_direct_message(sender_screen_name=user, )

        author = dm.authors_username

        self.assertEqual(user, author)
Exemple #3
0
    def test_dm_recipients_username_dm(self):
        # authenticating user
        user = '******'

        # @user -> @another_user messages should return 'another_user'
        expected_recipient = 'dialelo'
        dm = create_direct_message(sender_screen_name=user,
                                   recipient_screen_name=expected_recipient,)
        recipient_dm_user_is_sender = dm.dm_recipients_username(user)
        self.assertEqual(recipient_dm_user_is_sender, expected_recipient)

        # @another_user -> @user messages should return 'another_user'
        dm = create_direct_message(sender_screen_name=expected_recipient,
                                   recipient_screen_name=user,)
        recipient_dm_user_is_recipient = dm.dm_recipients_username(user)
        self.assertEqual(recipient_dm_user_is_recipient, expected_recipient)
Exemple #4
0
    def test_is_DM(self):
        # status is NOT a DM
        status = create_status()
        self.failIf(is_DM(status))

        dm = create_direct_message()
        self.failUnless(is_DM(dm))
Exemple #5
0
    def test_authors_username_dm(self):
        user = '******'
        dm = create_direct_message(sender_screen_name=user,)

        author = dm.authors_username

        self.assertEqual(user, author)
Exemple #6
0
    def test_dm_recipients_username_dm(self):
        # authenticating user
        user = '******'

        # @user -> @another_user messages should return 'another_user'
        expected_recipient = 'dialelo'
        dm = create_direct_message(sender_screen_name=user,
                                   recipient_screen_name=expected_recipient,)
        recipient_dm_user_is_sender = dm.dm_recipients_username(user)
        self.assertEqual(recipient_dm_user_is_sender, expected_recipient)

        # @another_user -> @user messages should return 'another_user'
        dm = create_direct_message(sender_screen_name=expected_recipient,
                                   recipient_screen_name=user,)
        recipient_dm_user_is_recipient = dm.dm_recipients_username(user)
        self.assertEqual(recipient_dm_user_is_recipient, expected_recipient)
Exemple #7
0
    def test_is_DM(self):
        # status is NOT a DM
        status = create_status()
        self.assertFalse(is_DM(status))

        dm = create_direct_message()
        self.assertTrue(is_DM(dm))
Exemple #8
0
    def test_dm_thread(self):
        message = create_direct_message()

        dm_thread_timeline = self.factory.thread(message)

        self.assertEqual(dm_thread_timeline.update_function.__name__,
                         'get_message_thread',)
        self.assertEqual(dm_thread_timeline._args[0], message)
Exemple #9
0
 def test_create_with_direct_message(self):
     # load the defaults
     direct_message = create_direct_message()
     StatusWidget(direct_message)
Exemple #10
0
 def test_create_with_direct_message(self):
     # load the defaults
     direct_message = create_direct_message()
     StatusWidget(direct_message)
Exemple #11
0
 def test_create_with_direct_message(self):
     # load the defaults
     configuration = Configuration()
     direct_message = create_direct_message()
     StatusWidget(direct_message, configuration)