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))
def test_authors_username_dm(self): user = '******' dm = create_direct_message(sender_screen_name=user, ) author = dm.authors_username self.assertEqual(user, author)
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)
def test_authors_username_dm(self): user = '******' dm = create_direct_message(sender_screen_name=user,) author = dm.authors_username self.assertEqual(user, author)
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))
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)
def test_create_with_direct_message(self): # load the defaults direct_message = create_direct_message() StatusWidget(direct_message)
def test_create_with_direct_message(self): # load the defaults configuration = Configuration() direct_message = create_direct_message() StatusWidget(direct_message, configuration)