class TestTwitterConnect(unittest.TestCase): def setUp(self): self.consumer_key = 'PUJLMjntjYSFUF7A1uyCQ' self.consumer_secret = '2ir3CCD1zzWRb0ubCSwCY3OtzoO24PEPkhy1OXlckQ' self.twitter = TwitterConnect(self.consumer_key, self.consumer_secret) def test_shold_get_request_token(self): self.twitter.get_request_token() assert(self.twitter.request_token) def test_should_get_request_token_secret(self): self.twitter.get_request_token() assert(self.twitter.request_token_secret) def test_should_get_correct_login_url(self): base_url = 'https://api.twitter.com/oauth/authorize?oauth_token=' self.twitter.get_request_token() url = self.twitter.get_authorize_url() self.assertEqual(url, base_url + self.twitter.request_token)
def setUp(self): self.consumer_key = 'PUJLMjntjYSFUF7A1uyCQ' self.consumer_secret = '2ir3CCD1zzWRb0ubCSwCY3OtzoO24PEPkhy1OXlckQ' self.twitter = TwitterConnect(self.consumer_key, self.consumer_secret)