Skip to content

Commit 945e193

Browse files
committed
Tests: Fix test_follow_and_delete
1 parent 284098f commit 945e193

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

‎stream/tests.py‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,20 @@ def test_follow_and_delete(self):
387387
agg_feed.follow(user_feed.slug, user_feed.user_id)
388388
user_feed.remove_activity(activity_id)
389389

390-
self._test_sleep(10, 0.25)
391-
392-
for x in range(5):
390+
for x in range(40):
393391
activities = agg_feed.get(limit=3)['results']
394392
activity = self._get_first_aggregated_activity(activities)
395-
activity_id_found = activity['id'] if activity is not None else None
396-
self.assertNotEqual(activity_id_found, activity_id)
397-
# self._test_sleep(1, 0.1)
393+
activity_id_found = (activity['id'] if activity is not None
394+
else None)
395+
396+
try:
397+
self.assertNotEqual(activity_id_found, activity_id)
398+
except AssertionError:
399+
self._test_sleep(1, 0.1)
400+
else:
401+
break
398402

403+
self.assertNotEqual(activity_id_found, activity_id)
399404

400405
# def test_follow_private(self):
401406
# feed = getfeed('secret', 'py1')

0 commit comments

Comments
 (0)