def test_5_fill_profile(self): # It's easiest to test with a public profile. auth = twitter.get_auth_for_self() user = self.enabled_user profile = twitter.fill_profile(user, auth=auth) self.assert_(profile) self.assertEquals(profile.user_location, "Seattle, WA") self.assertEquals(user.first_name, "One Hour Photo") self.assertEquals(user.last_name, "Hunt!") self.assert_(profile.photo) self.assert_(profile.photo.url) self.assert_(profile.photo_width > 0) self.assert_(profile.photo_height > 0)
def test_1_self(self): try: self.assert_(twitter.get_auth_for_self()) self.assert_(twitter.get_api_for_self()) except twitter.SelfNotEnabled: self.assert_(not self.is_self_enabled)