@@ -136,6 +136,7 @@ def test_add_activity_to(self):
136136 }
137137 response = user_feed .add_activity (activity_data )
138138 activity_id = response ['id' ]
139+ time .sleep (2 )
139140 # see if the new activity is also in the team feed
140141 activities = team_feed .get (limit = 1 )['results' ]
141142 self .assertEqual (activities [0 ]['id' ], activity_id )
@@ -236,8 +237,8 @@ def test_follow_and_delete(self):
236237 activity_data = {'actor' : actor_id , 'verb' : 'tweet' , 'object' : 1 }
237238 activity_id = user_feed .add_activity (activity_data )['id' ]
238239 agg_feed .follow (user_feed .slug , user_feed .user_id )
239- time .sleep (2 )
240240 user_feed .remove_activity (activity_id )
241+ time .sleep (2 )
241242 for x in range (5 ):
242243 activities = agg_feed .get (limit = 3 )['results' ]
243244 activity = self ._get_first_aggregated_activity (activities )
@@ -396,27 +397,28 @@ def test_mark_read(self):
396397 self .assertTrue (activities [1 ]['is_read' ])
397398
398399 def test_mark_seen (self ):
399- notification_feed = getfeed ('notification' , 'py3 ' )
400+ notification_feed = getfeed ('notification' , 'test_mark_seen ' )
400401 activity_data = {'actor' : 1 , 'verb' : 'tweet' , 'object' : 1 }
401- activity_id = notification_feed .add_activity (activity_data )[ 'id' ]
402+ notification_feed .add_activity (activity_data )
402403 activity_data = {'actor' : 2 , 'verb' : 'add' , 'object' : 2 }
403- activity_id_two = notification_feed .add_activity (activity_data )[ 'id' ]
404+ notification_feed .add_activity (activity_data )
404405 activity_data = {'actor' : 3 , 'verb' : 'watch' , 'object' : 3 }
405- activity_id_three = notification_feed .add_activity (activity_data )['id' ]
406+ notification_feed .add_activity (activity_data )
407+
406408 activities = notification_feed .get (limit = 3 )['results' ]
407409 for activity in activities :
408410 self .assertFalse (activity ['is_seen' ])
409411
410412 activities = notification_feed .get (limit = 3 )['results' ]
411- activities = notification_feed .get (mark_seen = [activities [0 ]['id' ], activities [1 ]['id' ]])['results' ]
413+ notification_feed .get (mark_seen = [activities [0 ]['id' ], activities [1 ]['id' ]])['results' ]
412414 activities = notification_feed .get (limit = 3 )['results' ]
413415 # is the seen state correct
414416 self .assertTrue (activities [0 ]['is_seen' ])
415417 self .assertTrue (activities [1 ]['is_seen' ])
416418 self .assertFalse (activities [2 ]['is_seen' ])
417419 # see if the state properly resets after we add another activity
418420 activity_data = {'actor' : 3 , 'verb' : 'watch' , 'object' : 3 }
419- activity_id_four = notification_feed .add_activity (activity_data )['id' ]
421+ notification_feed .add_activity (activity_data )['id' ]
420422 activities = notification_feed .get (limit = 3 )['results' ]
421423 self .assertFalse (activities [0 ]['is_seen' ])
422424 self .assertEqual (len (activities [0 ]['activities' ]), 2 )
0 commit comments