Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Commit ca387fe

Browse files
committed
add tests for UserStatus.connections
1 parent ab26ac0 commit ca387fe

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/test_models.py

+4
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,7 @@ def test_user_status(self):
190190
self.fail(e)
191191
self.assertTrue(user_status.AsJsonString())
192192
self.assertTrue(user_status.AsDict())
193+
194+
self.assertTrue(user_status.connections['blocking'])
195+
self.assertTrue(user_status.connections['muting'])
196+
self.assertFalse(user_status.connections['followed_by'])

twitter/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def connections(self):
321321
'muting': self.muting}
322322

323323
def __repr__(self):
324-
connections = [param for param in self._connections if getattr(self, param)]
324+
connections = [param for param in self.connections if getattr(self, param)]
325325
return "UserStatus(ID={uid}, ScreenName={sn}, Connections=[{conn}])".format(
326326
uid=self.id,
327327
sn=self.screen_name,

0 commit comments

Comments
 (0)