Skip to content

Commit 9ca7766

Browse files
committed
additional test for follow and delete
1 parent 18d9b17 commit 9ca7766

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎stream/tests.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,22 @@ def test_follow_and_source(self):
228228
activity_id_found = activity['id'] if activity is not None else None
229229
self.assertEqual(activity['origin'], feed.id)
230230
self.assertEqual(activity_id_found, activity_id)
231+
232+
def test_follow_and_delete(self):
233+
user_feed = getfeed('user', 'test_follow')
234+
agg_feed = getfeed('aggregated', 'test_follow')
235+
actor_id = random.randint(10, 100000)
236+
activity_data = {'actor': actor_id, 'verb': 'tweet', 'object': 1}
237+
activity_id = user_feed.add_activity(activity_data)['id']
238+
agg_feed.follow(user_feed.slug, user_feed.user_id)
239+
time.sleep(2)
240+
user_feed.remove_activity(activity_id)
241+
for x in range(5):
242+
activities = agg_feed.get(limit=3)['results']
243+
activity = self._get_first_aggregated_activity(activities)
244+
activity_id_found = activity['id'] if activity is not None else None
245+
self.assertNotEqual(activity_id_found, activity_id)
246+
time.sleep(1)
231247

232248
def test_follow_private(self):
233249
feed = getfeed('secret', 'py1')

0 commit comments

Comments
 (0)